[Q] XML of app being shown instead of the app itself - Android Q&A, Help & Troubleshooting

Jul 11
Hello All,
I have an issue in my App.
I have three activities called A , B ,C
In the activity A I have a button and onclick of that I open another Activity called ShowChart.Onback press of ShowChart Activity I navigate to Activity A
Onback press of Activity A I close the App.
Following is the Problem
------------------------------------------
When I open ShowChart Activity and do backpress I go to Activity A which is fine but when I again do back press from Activity A my App gets Closed but XML of the
ShowChart Activity is shown instead of normal close of the App.
Any Help would be appreciated.Thanks in Advance

Related

[Q] activity properties

Hi every one
I have already develop a new android app, this app have three activities:
the first one :
there is just one button when the user press the button it will transfer him to the second activity and this is the default activity
the second one:
there is multiple edit Texts and spinner item and two buttons the user fill the data and when he press the save button it will save the data in a shared preference and transfer him to the third activity
the third one:
it is a list activity and it will list the shared preference that the user saved
so if there is a shared preference I have change the default activity to the third activity, if not it will stay the first activity
how I can do that ????
and thanks for helping...:good:

how to create master page to contain view

i plan to create a master page with navigator menu on top. user click a item in menu to fire a new Intent start a new activity and display view, and navigator menu must remain on top, any suggested method can i refer, kindly advice, thanks in advance.

[Q] activity change problem

Hi!
I'm developing an android app. This app have got 3 activity. On the first activity i have two button. the first button is navigate the user the second activity, and the second activity navigate to the third activity.
the second button on the first activity is use the phone camera, and i would like to navigate to the third activity, but my app dont do this.
If i click on the second button on first activity the app show me the third activity, and after the third activity show me the camera.
I use this code to change activitys:
Code:
Intent kapcsolat = new Intent(v.getContext(), SECONDACTIVITY.class);
startActivity(kapcsolat);
and i use this code to use the phone camera:
Code:
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
fileuri = getOutputMediaFileUri(KEP);
intent.putExtra(MediaStore.EXTRA_OUTPUT, fileuri);
startActivityForResult(intent, kamera_kep);
My second button code:
Code:
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
fileuri = getOutputMediaFileUri(KEP);
intent.putExtra(MediaStore.EXTRA_OUTPUT, fileuri);
startActivityForResult(intent, kamera_kep);
Intent kapcsolat = new Intent(v.getContext(), SECONDACTIVITY.class);
startActivity(kapcsolat);
Could you help me in my problem?
Now my app work as this:
First activity -> second button -> Third Activity -> Camera activity
But i would like to work as this:
First activity -> second button ->Camera activity -> Third Activity
sorry for my bad english, i hope you understand me.

[Q] App to perform the same effect as the touch button task shifting

Good evening, I'm a newbie, I read about intent, activity and other things in Android but can not get the effect I want.
I would make exactly the same action that causes the button to the left. "switch between tasks" of a Galaxy Tab 4. Run the code in my application and pass to any previously opened application.
I've tried several codes like this, and I've also searched some information about the PID of the process, but I know not to handle them too well:
Intent intent1 = new Intent(Intent.ACTION_VIEW); // OR ACTION_MAIN ??
intent1.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT );
intent1.addCategory(Intent.CATEGORY_LAUNCHER);
PackageManager manager = getPackageManager();
intent1 = manager.getLaunchIntentForPackage("com.other.externalapp");
startActivity(intent1);
PD: This code works, but it opens a new instance of "com.other.externalapp" and not what I want, it close an internal connection of "externalapp". I want exactly the same effect achieved with switching between applications with the Galaxy tab touch button.
Maybe it's a permission problem, or to be able to run the exact same PID already open.
Thank you very much for your help people. :good:

Why System Displays a Pop-up Window Twice Asking Users to Add the App to Home Screen When Users Return from a Quick App Opened Through a Deep Link?

Symptom​When a user opens a quick app from AppGallery and returns, a pop-up window is displayed only once to ask the user to add the app icon to the home screen. However, the pop-up window will be displayed twice when the user opens the quick app through a deep link and then returns.
Cause Analysis​Based on the analysis of the page code, it is found that the onBackPress function (for listening to the back button) is overridden.
Java:
onBackPress:function(){
this.entryDirect && this.$app.exit()
}
this.entryDirect is carried during deep link redirection.
onBackPress is triggered when a user taps the back button. If value true is returned, the return logic of the app is used; if value false is returned, the default return logic is used. If no value is returned, the default return logic is used.
The system determines that the quick app is opened through a deep link, and this.app.exit() is called to exit the app. In this case, the finish event is triggered. However, value true is not returned in onBackPress. Then, the finish event is triggered based on the default return logic. After Quick App Center detects the finish event, a pop-up window is displayed to instruct the user to add the app icon to the home screen. As a result, the pop-up window is displayed twice.
Solution​Modify code of the onBackPress function. After this.app.exit() is called to exit the app, the default return logic is not used.
Java:
onBackPress:function(){
if(this.entryDirect){
this.$app.exit()
return true
}
}
Suggestions and Summary​When a page needs to use the onBackPress function to process its own logic, true must be returned at the end of the function. Otherwise, the system return logic is used by default after the onBackPress function is processed, which may cause exceptions.
Checkout in forum

Categories

Resources