Tuesday, September 7, 2010

[android-developers] Implicit intent - call to another activity doesnt work if action name is defined as user defined names.

Hi all,

implicit intent with class name as action defined in intentfilter. is
not working.
Only it it is defined as "android.intent.action." it is picked up ? is
it so ?

I have app A with the following in manifest.xml file

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.localguide"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/
app_name">
<activity android:name=".welcomeScreen"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".results">
<intent-filter>
<action android:name="android.intent.action.GET_RESULT"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<intent-filter>
<action
android:name="com.android.localguide.intent.action.GET_RESULT"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>

<activity android:name=".options"/>
<activity android:name=".information"/>
</application>
<uses-permission android:name="android.permission.INTERNET">
</uses-permission>

</manifest>

In app B, i tried to call the activity in A using below code.

button.setOnClickListener(new Button.OnClickListener(){
public void onClick(View v) {
Intent i = new Intent();

i.setAction("com.android.localguide.intent.action.GET_RESULT");
//i.setAction("android.intent.action.GET_RESULT"); --
> This code works. But not above line.
startActivity(i);
}
});

Could someone point me why it is not working ? It crashes saying
activity not found.
Note: I run the app A in bckground.

Thanks,
Mani

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate