Back to project page vgandroid-demo.
The source code is released under:
GNU Lesser General Public License
If you think the Android project vgandroid-demo listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
// Copyright (c) 2012-2013, https://github.com/rhcad/touchvg // www.jav a 2s . com package touchvg.demo1; import android.app.ListActivity; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.ArrayAdapter; import android.widget.ListView; public class MainActivity extends ListActivity { private static final String TAG = "vgdemo"; private static final String[] VIEWS = new String[] { "ExampleActivity1", "ExampleActivitySF", "ExampleActivityPager", "ExampleActivityImagePager", "DragObserverActivity" }; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, android.R.id.text1, VIEWS)); } @Override protected void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); try { String name = "touchvg.demo1." + VIEWS[position]; Class<?> cls = Class.forName(name); Intent i = new Intent(this, cls); startActivity(i); } catch (Exception e) { Log.d(TAG, "onListItemClick", e); } } }