1. SourceCode:
?Repo on github/EsptouchForAndroid
2. Integration
a). 拷貝以下 Java 文件到自己的工程达罗,注意文件中的import 路徑需要做相應(yīng)修改。
拷貝java class 到自己的工程
b). 拷貝esptouch_demo_activity.xml
到自己的layout
目錄绍载。同時(shí)將相關(guān)strings.xml
中的string
添加到自己工程中滔蝉,拷貝arrays.xml
到values
目錄.
c). 修改AndroidManifest.xml
添加如下:
<activity android:name="com.xxxxxx.app.EsptouchDemoActivity" android:screenOrientation="portrait" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category >android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>
d). 切換到Smart config 的EsptouchDemoActivity
public void smartConfig() {
Intent intent= new Intent(getApplicationContext(), EsptouchDemoActivity.class);
//Log.d("INFO", "before start activity");
startActivity(intent);
}
e). 回到之前的activity
在config頁(yè)面可以添加一個(gè)返回的Button,
在EsptouchDemoActivity 中監(jiān)聽Button的click event
mBtnBack = (Button) findViewById(R.id.btnBack);
mBtnBack.setOnClickListener(this);
在onClick 函數(shù)中添加如下蝠引,來(lái)結(jié)束當(dāng)前Activity。
if (v == mBtnBack) {
this.finish();
}
上面只是一個(gè)簡(jiǎn)單的集成螃概,僅供參考。