If you think the Android project AndroidRecording listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package com.skd.androidrecordingtest;
//www.java2s.comimport android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;
publicclass MainActivity extends Activity {
@Override
protectedvoid onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ListView list = (ListView) findViewById(android.R.id.list);
ArrayAdapter<String> listAdapter = new ArrayAdapter<String>(getApplicationContext(),
android.R.layout.simple_list_item_1,
getResources().getStringArray(R.array.activities));
list.setAdapter(listAdapter);
list.setOnItemClickListener(new OnItemClickListener() {
@Override
publicvoid onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
launchDemo(arg2);
}
});
}
privatevoid launchDemo(int position) {
switch (position) {
case 0: default: {
Intent i = new Intent(MainActivity.this, AudioRecordingActivity.class);
startActivity(i);
break;
}
case 1: {
Intent i = new Intent(MainActivity.this, VideoRecordingActivity.class);
startActivity(i);
break;
}
}
}
}