Activity Problem

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

Activity Problem

Postby and.modi » Sun Nov 16, 2008 8:42 pm

Hi,
I am facing one wiered problem.
I have created 4 intent reciver in my AndroidManifeast.xml file. And I have created 4 class for that and the code is working perfectly. The problem is when ever I launch emulator to lauch application, I can see 4 diffrent acitivities which I have created also along with the main application. How can I solve that.
The code is as follows:
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2. <?xml version="1.0" encoding="utf-8"?>
  3.  
  4. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  5.  
  6.      package="com.naag"
  7.  
  8.      android:versionCode="1"
  9.  
  10.      android:versionName="1.0.0">
  11.  
  12.     <application android:icon="@drawable/icon" android:label="@string/app_name">
  13.  
  14.         <activity android:name=".naag"
  15.  
  16.                  android:label="@string/app_name">
  17.  
  18.             <intent-filter>
  19.  
  20.                 <action android:name="android.intent.action.MAIN" />
  21.  
  22.                 <category android:name="android.intent.category.LAUNCHER" />
  23.  
  24.             </intent-filter>
  25.  
  26.         </activity>
  27.  
  28.        
  29.  
  30.         <!-- Intent for Menu -->
  31.  
  32.         <activity android:name=".menu"
  33.  
  34.                  android:label="@string/menu">
  35.  
  36.             <intent-filter>
  37.  
  38.                 <action android:name="android.intent.action.MAIN" />
  39.  
  40.                 <category android:name="android.intent.category.LAUNCHER" />
  41.  
  42.             </intent-filter>
  43.  
  44.         </activity>
  45.  
  46.         <!-- Intent for Contact Me -->
  47.  
  48.         <activity android:name=".Contact"
  49.  
  50.                  android:label="@string/contact">
  51.  
  52.             <intent-filter>
  53.  
  54.                 <action android:name="android.intent.action.MAIN" />
  55.  
  56.                 <category android:name="android.intent.category.LAUNCHER" />
  57.  
  58.             </intent-filter>
  59.  
  60.         </activity>
  61.  
  62. <!-- Intent for Credits -->
  63.  
  64.           <activity android:name=".Credits"
  65.  
  66.                  android:label="@string/credit">
  67.  
  68.             <intent-filter>
  69.  
  70.                 <action android:name="android.intent.action.MAIN" />
  71.  
  72.                 <category android:name="android.intent.category.LAUNCHER" />
  73.  
  74.             </intent-filter>
  75.  
  76.         </activity>
  77.  
  78. <!-- Intent for Level Selection-->
  79.  
  80.         <activity android:name=".LevelRadio"
  81.  
  82.                  android:label="@string/selectlevel">
  83.  
  84.             <intent-filter>
  85.  
  86.                 <action android:name="android.intent.action.MAIN" />
  87.  
  88.                 <category android:name="android.intent.category.LAUNCHER" />
  89.  
  90.             </intent-filter>
  91.  
  92.         </activity>
  93.  
  94.      </application>
  95.  
  96. </manifest>
  97.  
  98.  
Parsed in 0.007 seconds, using GeSHi 1.0.8.4


And the Image is attaced there.
Attachments
Problem.JPG
The icons shown in box are useless and not needed.
Problem.JPG (38.1 KiB) Viewed 2904 times
and.modi
Junior Developer
Junior Developer
 
Posts: 14
Joined: Sat Jul 26, 2008 9:17 am

Top

Postby MrSnowflake » Sun Nov 16, 2008 9:02 pm

Remove the
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <intent-filter>
  2.  
  3.                 <action android:name="android.intent.action.MAIN" />
  4.  
  5.                 <category android:name="android.intent.category.LAUNCHER" />
  6.  
  7.             </intent-filter>
Parsed in 0.001 seconds, using GeSHi 1.0.8.4
exept one.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby and.modi » Mon Nov 17, 2008 6:40 pm

Yes,
I got it.
I put
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2. <category android:name="android.intent.category.SAMPLE_CODE" />
  3.  
  4.  
Parsed in 0.000 seconds, using GeSHi 1.0.8.4


but should I put this line or it will work without this also?
in every other intent except my main one.
Thaks 4 help. :D
and.modi
Junior Developer
Junior Developer
 
Posts: 14
Joined: Sat Jul 26, 2008 9:17 am

Postby jagtap.jj1 » Tue Nov 25, 2008 9:14 am

You can put <category android:name="android.intent.category.SAMPLE_CODE" />
Or Also u can put <category android:value="android.intent.category.DEFAULT" />
in intent except main
Or category depends on intent and action.
java-android developer
User avatar
jagtap.jj1
Senior Developer
Senior Developer
 
Posts: 124
Joined: Fri Aug 22, 2008 11:52 am
Location: India(Mumbai)

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 6 guests