Shr*_*jan 11 android android-widget android-emulator android-layout
我知道我们可以使用方法putExtra()
和getExtra
方法将任何具有其值的对象传递给另一个活动.但现在我想知道是否可以将数组传递给另一个Activity
?或者,如果是,那么让我知道如何将数组传递给另一个Activity
?谢谢.
Kam*_*mal 31
Bundle b = new Bundle();
b.putStringArray(key, new String[]{value1, value2});
Intent i=new Intent(context, Class);
i.putExtras(b);
Run Code Online (Sandbox Code Playgroud)
并接受
Bundle b = this.getIntent().getExtras();
String[] array=b.getStringArray(key);
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
23368 次 |
最近记录: |