我的申请有问题。问题是我无法在活动之间从一个选项卡切换到另一个选项卡。这是我的代码:
public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft) {
String n = tab.getText().toString();
Toast.makeText(getApplicationContext(), "You have selected: " + n, Toast.LENGTH_LONG).show();
if (n =="Converter") {
startActivity(new Intent ("com.example.currencyconverter.MainActivity"));
}
if (n =="Currencies") {
startActivity(new Intent ("com.example.currencyconverter.FirstActivity"));
if (n=="News") {
startActivity(new Intent ("com.example.currencyconverter.FirstActivity"));
}
}
}
我的应用程序崩溃了。问题是什么?任何帮助将不胜感激。