I would like to get USB Mass Storage activity to turn on or off the usb mode when device is connected to pc.I have implemented an application as follows.
public class USB_ConnectActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final String state = Environment.getExternalStorageState();
((Button)findViewById(R.id.onButton)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (!(Environment.MEDIA_SHARED.equals(state))) {
//How to navigate android USB Mass Storage page
}
}
});
((Button)findViewById(R.id.offButton)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if ((Environment.MEDIA_SHARED.equals(state))) {
//How to navigate android USB Mass Storage page
}
}
});
}
}
from the above code I have used two buttons for turn off and on usb mass storage.But I don't have more information about it to navigate android in built USB Mass Storage page. Please any body help me.