Coming back from Android Market does not show app again - android

I am starting market intent to go my app. It starts well and also showing my app. But problem with this is when pressing back, it is not coming to my my app again. Also when pressing home in market, again launch app, it shows market page instead of app.
Here is the code which i am using.
Intent marketIntent = new Intent(Intent.ACTION_VIEW);
marketIntent.setData(Uri.parse("market://details?id=" + AndroidUtils.getPackageName()));
marketIntent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
startActivity(marketIntent);
Thanks in advance!

use
Intent marketIntent = new Intent(Intent.ACTION_VIEW);
marketIntent.setData(Uri.parse("market://details?id=" + AndroidUtils.getPackageName()));
startActivity(marketIntent);
don't use the flags because the activities are cleared when u use these flags

Related

How to remove application history in Android?

I have an application in which I want to show a custom activity(Access Denied) when user try to share an image.
When I am trying to share an image from default 'Downloads' application (For eg: share image through default message/gmail application) the custom activity is showed and exits 'Downloads' application.But next time when I launch the 'Downloads' application and press on an image the previously created draft mail/message is shown as the top activity.So it shows the custom activity always.
Launched the 'Downloads' application by using this intent.
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setFlags( Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setComponent(new ComponentName(packagename,className));
startActivity(intent);
How can I fix this? I want to launch the 'Downloads' application as new (removing history of gmail/message etc.) every time.
Please try below code
Intent intent = new Intent(ClassA.this, ClassB.class);
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivity(intent);

Starting a browser but should not be shown in recents

i am starting the browser with intent using
Intent i = new Intent();
i.setAction(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
i.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
startActivity(i);
but when i see recent applications i see
Internet
before my Application.
I dont want Internet to be shown at all in recent when i launch it as sub-application of mine.
Is there a flag to do so??
thanks.
use Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS with your intent
i.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS)

How to implement rating functionality in android app?

I am developing an android app. i want to implement rate functionality in android market? There is button in app exit. I want that when i click exit an pop up should open which redirect on android market rating page. if rated already it should not redirect on android market and show you have rated alreay message. how can i achieve this.api returns anything after adding rating.
To redirect to your app you can use:
Uri marketUri = Uri.parse("market://details?id=" + packageName);
Intent marketIntent = new Intent(Intent.ACTION_VIEW, marketUri);
startActivity(marketIntent);
Also, to check if already rated or not, save a boolean in SharedPreferences and check it.
Rating an android app within an application
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=com.test(package name)"));
startActivity(intent);

Is there an intent to launch Android Market to "My Apps" page?

Like the title says. Is there an intent to launch android market to the "My Apps" page?
I have a dialog that displays if the app is out of date. I'd like to put a button on the dialog that leads directly to the "My Apps" page so the user can download the update.
Edit: For clarity, I'm not talking about the details page for my app. I'm talking about the "My Apps" section of the Android Market application.
See this: http://developer.android.com/guide/publishing/publishing.html#marketintent for everything you want to know.
EDIT: try this. Do note that this might change if the Market app is updated to use a different activity.
Intent i = new Intent("android.intent.action.VIEW");
i.setComponent(new ComponentName("com.android.vending","com.android.vending.MyDownloadsActivity"));
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);
This solution has been working for me flawlessly across many Gplay versions so far. Here's a summary:
Intent intent = new Intent("com.google.android.finsky.VIEW_MY_DOWNLOADS");
intent.setClassName("com.android.vending", "com.google.android.finsky.activities.MainActivity");
startActivity(intent);
The latest version of Play Store app is fragment based. You cannot open the "My Apps" because it's hosted in the same activity as the rest of fragments. The best you can do is to open the main activity and let user navigate to the "My Apps".
Intent marketIntent = new Intent(Intent.ACTION_VIEW)
.setComponent(new ComponentName("com.android.vending",
"com.google.android.finsky.activities.MainActivity"))
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(marketIntent);

Is there a way to direct the user to the market for another app?

I want to direct the user from one app the user is currently running, to the market, to download another app.
The link to the market is: market://search?q=pname:your.package.name
use this in your code:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=com.android.example"));
startActivity(intent);
from: http://developer.android.com/guide/publishing/publishing.html#marketintent
Yes. Try this:
Intent intent = new Intent(Intent.ACTION_VIEW,
Uri.parse("https://market.android.com/details?id=com.hg.cyberlords"));
c.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
c.startActivity(intent);
This will open the market app with "Cyberlords" app.

Categories

Resources