How to send data between one application to other application in android?

前端 未结 6 1085
再見小時候
再見小時候 2020-12-11 18:00

i\'ve tried to sending data between App1 to App2 via Intent in Android

i used this code but i couldn\'t resolve my problem.

<
6条回答
  •  南方客
    南方客 (楼主)
    2020-12-11 18:41

    This should work:

    APP1

        Intent i2 = new Intent();
        i2.setComponent(new ComponentName(PACKAGE,ACTIVITY));//the destination packageName
        i2.putExtra("Id", "100");
        startActivity(i2);
        
    

    APP2

        String myString = getIntent().getStringExtra("Id");
    

提交回复
热议问题