Hi, All:

I meet a problem that failed to share two activity in the same process. the 
story as below:

1. My APK include a tab activity which contain two TAB page, and the TAB Page 
just embedded another activity using intent.
2. TAB Page 1 invoke the Activity 1 which is also inside my APK. TAB page 2 
invoke the Activity 2 which is in another APK.
3. in running time, the exception occurred since the Activity embedded into TAB 
Activity must be in same process.

Then i resolve this issue as below:

1. My APK(name as APK1) include MyTabActivity and Activity 1.      another 
APK(name it as APK2) include the Activity2.
2. APK2 will running after Power on automatically. and APK1 only will run when 
user launch it.
3. Activity 2 in APK only is invoked from MyTabActivity, and is not used by any 
others.
4. My Requirement is:

   APK running in Process 1, then when invoke Activity 2, Activity 2 running 
into Process 1, Not in APK2's process.

5. Then i do as below:

  a.  Use same certificate in APK 1 and APK2's mk file, as below

LOCAL_CERTIFICATE := platform 

  b.  set same shareuserid in APK1 & APK2's manifest xml, as such:

   APK1:       <application android:icon="@drawable/icon" 
android:label="@string/app_name" android:sharedUserId="samename">
      
   APK2:   <application android:name="app"
            android:label="@string/app_label"
            android:icon="@drawable/ic_launcher_app"
            android:taskAffinity="android.task.app"
            android:allowTaskReparenting="true"
            android:sharedUserId="samename">

  c. Set same Process name for APK1's all activity and only the activity2 of 
APK2

   APK1:  <activity android:name=".MyTabActivity"
                  android:label="@string/app_name"
                  android:process="com.android.sameprocess">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" /> 
            </intent-filter>
        </activity>

        <activity android:name=".Activity1" 
android:process="com.android.sameprocess">
        </activity>

   APK2:  
 <activity android:name=".Activity2"
            android:label="@string/xxx"
            android:process="com.android.sameprocess">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <action android:name="android.intent.action.VIEW" />
            </intent-filter>
        </activity>


BUT Failed.....The Exceptions still occurred. What is the matter, how to 
resolve it??

Any one can help me, it is urgent. thx a lot.




nicefuture

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to