0

Hello my question is a bit difficult let me explain and try to understood

I have a custom Home who is set as default when user press home. Know i need a way to ask wich home use when i press on a setting key, or a way to launch Setting activity for delete home default action.

In fact i wan't a way to go back to home app installed by google instead of mine just in case.

I need this because my custom home is still in dev and don't have all feature yet.

I need to keep my home as a default action when user press home buton but i need to add a home selector in special case.

I have try to use finish() when i need to go back to old home but mine as default is automaticly relaunch because he is the default one.

Any idea?

EDIT

I try to reformul a bit.

I'm making a home apps. I set it as default on my tablet. My home apps don't have all feature yet. And when i will launch something or go to setting i need to relaunch default home app.

So i need a way inside my app to reset default home action or launch a home apps, or ask user to choice wich app he will use has home apps.

Hope this is clear for all.

Jebik
  • 778
  • 2
  • 8
  • 26

1 Answers1

1

Probably you should use this one to implement your idea. keep the below lines in your manifest file.

  <activity android:name="Home"
                android:theme="@style/Theme"
                android:launchMode="singleInstance"
                android:stateNotNeeded="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.HOME"/>
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

For more info about the sample project. just go the below path in your Android SDK

\android-sdk\samples\android-8\Home

EDIT : Hi Please check this to pro grammatically unset the default application.

  1. How do I use PackageManager.addPreferredActivity()?

for more info go through this also to clear the clearPackagePreferredActivities

http://developer.android.com/reference/android/content/pm/PackageManager.html#clearPackagePreferredActivities%28java.lang.String%29

hope this helps you.

Community
  • 1
  • 1
itsrajesh4uguys
  • 4,610
  • 3
  • 20
  • 31