• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

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

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

<activity
android:label="@string/app_name"
android:name=".yourclassname.java" >
<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>

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
 
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:
<activity
    android:label="@string/app_name"
    android:name=".MyLauncherHomeActivity" >

  <intent-filter >
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
  </intent-filter>

  <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>
 
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:
<activity
    android:label="@string/app_name"
    android:name=".MyLauncherHomeActivity" >

  <intent-filter >
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
  </intent-filter>

  <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>





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
 
Back
Top Bottom