私mainactivity
は2つのタブを含み、次のコードを持っています:
public class MainActivity extends Activity {
private class MyTabListener implements ActionBar.TabListener
{
private Fragment mFragment;
private final Activity mActivity;
private final String mFrag;
public MyTabListener( Activity activity, String fragName )
{
mActivity = activity;
mFrag = fragName;
}
@Override
public void onTabReselected( Tab tab, FragmentTransaction ft )
{
// TODO Auto-generated method stub
}
@Override
public void onTabSelected( Tab tab, FragmentTransaction ft )
{
mFragment = Fragment.instantiate( mActivity, mFrag );
ft.add( android.R.id.content, mFragment );
}
@Override
public void onTabUnselected( Tab tab, FragmentTransaction ft )
{
ft.remove( mFragment );
mFragment = null;
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ActionBar ab = getActionBar();
ab.setNavigationMode( ActionBar.NAVIGATION_MODE_TABS );
Tab tab = ab.newTab()
.setText( "Current Trip" )
.setTabListener(
new MyTabListener( this, current.class.getName() ) );
ab.addTab( tab );
tab = ab.newTab()
.setText( "Display Result" )
.setTabListener(
new MyTabListener( this, display.class.getName() ) );
ab.addTab( tab );
File folder = new File(Environment.getExternalStorageDirectory() + "/tc");
boolean success = true;
if (!folder.exists()) {
//Toast.makeText(MainActivity.this, "Directory Does Not Exist, Create It", Toast.LENGTH_SHORT).show();
success = folder.mkdir();
}
if (success) {
//Toast.makeText(MainActivity.this, "Directory Created", Toast.LENGTH_SHORT).show();
} else {
//Toast.makeText(MainActivity.this, "Failed - Error", Toast.LENGTH_SHORT).show();
}
}
}
edittext のデータを から表示して計算current.class
に使用するにはどうすればよいですか?display.class