How to replace Home.apk when power on?

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

How to replace Home.apk when power on?

Postby bercago » Thu Dec 18, 2008 11:57 am

Hello,
I am tring to replace home.apk which is the first running activity when power on,
I create a new activity called "MyHome" and try to use this activity to replace Home.apk.
Here is what I have modified the AndroidManifest.xml of MyHome activity.
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2. <intent-filter>
  3.  
  4. <action android:name="android.intent.action.MAIN" />
  5.  
  6. <category android:name="android.intent.category.HOME"/>
  7.  
  8. <category android:name="android.intent.category.DEFAULT" />
  9.  
  10. </intent-filter>
  11.  
  12.  
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


When executing this activity, the emulator shows a selection menu to ask me select an activity when power on, Home or MyHome.

I tried to remove Home.apk, but I can not find this apk in system\app\,
and I also tried the following solution:
http://www.anddev.org/launch_activity_o ... -t428.html
But Home.apk is still running followed by MyHome.apk.

And I also found some information about my question in other forum:
http://markmail.org/message/3lkfz6fqlbu ... te:results
And someone from Google said:
However, since we currently don't have a way to let users specify the preferred Activity to use for a given Intent filter, the user will get a prompt to pick the correct Activity. We plan to improve that in a future SDK release.

I think the solution to my question is to figure out how to remove Home.apk from emulator (or Android platform), or do you guys know other method to put my own Home activity to Android device?

Thanks
bercago
bercago
Freshman
Freshman
 
Posts: 9
Joined: Thu Dec 18, 2008 11:38 am

Top

Postby MrSnowflake » Thu Dec 18, 2008 12:29 pm

You can add a priority to this intent filter, at least that's what I've read somewhere.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby bercago » Fri Dec 19, 2008 4:24 am

Hi MrSnowflake,
Thanks for your help!
I tried your suggestion and it works fine!

Here is the solution for this problem, add this part to Androidmanifest.xml
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2. <intent-filter android:priority="1">
  3.  
  4. <action android:name="android.intent.action.MAIN" />
  5.  
  6. <category android:name="android.intent.category.HOME"/>
  7.  
  8. <category android:name="android.intent.category.DEFAULT" />
  9.  
  10. </intent-filter>
  11.  
  12.  
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


Then my home activity replace the original one and no selection need to be made!

And I also find another post related to this issue:
http://www.anddev.org/home_screen_widgets-t3315.html

Thanks and Regards,
bercago
bercago
Freshman
Freshman
 
Posts: 9
Joined: Thu Dec 18, 2008 11:38 am

Postby Nemat » Fri Nov 27, 2009 1:29 pm

Hi bercago....

I have tried your code.I mean I used these entries in my manifest but it still asks the user to choose from different home screens.Is there any thing wrong or it requires any other change????

Here is my manifest:
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".Home"
>
<intent-filter android:priority="1">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

</application>
<uses-permission android:name="android.permission.SET_PREFERRED_APPLICATIONS"></uses-permission>


Thanks in Advance
Nemat
Nemat
Experienced Developer
Experienced Developer
 
Posts: 62
Joined: Thu Aug 21, 2008 3:16 pm
Location: Jaipur

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Google [Bot] and 6 guests