Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

New Forums: Nexus Player | Nexus 9
test: Reply
 
LinkBack Thread Tools
Old February 12th, 2012, 01:47 PM   #1 (permalink)
Junior Member
Thread Author (OP)
 
powerpoint45's Avatar
 
Join Date: Dec 2011
Posts: 58
 
Device(s):
Carrier: Not Provided

Thanks: 23
Thanked 5 Times in 4 Posts
Question (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

Advertisements
powerpoint45 is offline  
Reply With Quote
sponsored links
Old February 12th, 2012, 03:39 PM   #2 (permalink)
Member
 
Join Date: Oct 2011
Location: Sydney, Australia
Posts: 191
 
Device(s): Galaxy Nexus GSM
Carrier: Not Provided

Thanks: 2
Thanked 37 Times in 33 Posts
Default

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>
jiminaus is offline  
Last edited by jiminaus; February 12th, 2012 at 03:52 PM. Reason: Re-worked the post.
Reply With Quote
The Following 2 Users Say Thank You to jiminaus For This Useful Post:
alostpacket (February 12th, 2012), powerpoint45 (February 12th, 2012)
Old February 12th, 2012, 07:16 PM   #3 (permalink)
Junior Member
Thread Author (OP)
 
powerpoint45's Avatar
 
Join Date: Dec 2011
Posts: 58
 
Device(s):
Carrier: Not Provided

Thanks: 23
Thanked 5 Times in 4 Posts
Thumbs up

Quote:
Originally Posted by jiminaus View Post
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
powerpoint45 is offline  
Last edited by powerpoint45; February 13th, 2012 at 10:50 AM.
Reply With Quote
Reply
Tags
force close, force close on boot, manifest


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 05:26 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.