发布于 2016-02-17 21:34:27 | 90 次阅读 | 评论: 0 | 来源: 网友投递
Android移动端操作系统
Android是一种基于Linux的自由及开放源代码的操作系统,主要使用于移动设备,如智能手机和平板电脑,由Google公司和开放手机联盟领导及开发。尚未有统一中文名称,中国大陆地区较多人使用“安卓”或“安致”。
Intent intent = new Intent();
intent.setClass(A.this, B.class);
Bundle bundle = new Bundle();
bundle.putString("name", "xiaozhu");
intent.putExtras(bundle);
startActivity(intent);
Intent intent = this.getIntent();
Bundle bundle = intent.getExtras();
String name = bundle.getString("name");
[java] view plaincopy
Intent intent = this.getIntent();
Bundle bundle = intent.getExtras();
String name = bundle.getString("name");
class MyApp extends Application {
private String myState;
public String getState() {
return myState;
}
public void setState(String s) {
myState = s;
}
}
<application android:name=".MyApp" android:icon="@drawable/icon" android:label="@string/app_name">
class Blah extends Activity {
@Override
public void onCreate(Bundle b){
...
MyApp appState = ((MyApp)getApplicationContext());
String state = appState.getState();
...
}
}