Android 打开另一个APP,并传参
生活随笔
收集整理的這篇文章主要介紹了
Android 打开另一个APP,并传参
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1、在待打開的APP注冊可被外APP調用的activity
<activity android:name=".TwoActivity"><intent-filter ><action android:name="android.intent.action.VIEW" /><category android:name="android.intent.category.DEFAULT"/><data android:scheme="test"android:host="com.example.mvvmtest"android:path="/home" /></intent-filter> </activity>注:host是包名
2、任意APP打開已注冊的開放的activity
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("test://com.example.mvvmtest/home")); intent.putExtra("name","aacc44"); startActivity(intent);總結
以上是生活随笔為你收集整理的Android 打开另一个APP,并传参的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Maven属性(properties)标
- 下一篇: android sina oauth2.