(q) my application wont work unless i click on it from another launcher

Last Updated:

  1. powerpoint45

    powerpoint45 Well-Known Member

    Ive gotten pretty far on my own launcher.I used this code to make it so when you click home your launcher appears:

    android:name=".yourclassname.java" >
    <intent-filter >
    <action android:name="android.intent.action.MAIN" />
    android:name="android.intent.category.HOME" />
    android:name="android.intent.category.DEFAULT" />

    This works but when i reboot and click on my launcher from the dialogue that pops up to select your launcher, it force closes. To fix this temporarily i just click on my app from a different launcher. Anyone have an idea on how to fix this? THANKS

  2. jiminaus

    jiminaus Well-Known Member

    If you actually have android:name=".yourclassname.java" in your AndroidManifest.xml, that will be the problem.

    But instead of fixed that, I think you have a more fundamental structural problem in your AndroidManifest.xml.

    You want the same activity to start in both cases right? Then you just have one acitivity with multiple sets of intent-filters.

    Move the stuff between <intent-filter> ... </intent-fitler> to inside the activity with the MAIN and LAUNCHER intent-filter.

    For example:
    Code (Text):
    2. <activity
    3.     android:label="@string/app_name"
    4.     android:name=".MyLauncherHomeActivity" >
    6.   <intent-filter >
    7.     <action android:name="android.intent.action.MAIN" />
    8.     <category android:name="android.intent.category.LAUNCHER" />
    9.   </intent-filter>
    11.   <intent-filter >
    12.     <action android:name="android.intent.action.MAIN" />
    13.     <category android:name="android.intent.category.HOME" />
    14.     <category android:name="android.intent.category.DEFAULT" />
    15.   </intent-filter>
    17. </activity>
    alostpacket and powerpoint45 like this.
  3. powerpoint45

    powerpoint45 Well-Known Member

    You are a very smart person.I thank you so much...it works like a charm.I love the quick replies..that's why i like this website more than xda

Share This Page