我想在udacity中通过google的android编程课程(android studio)学习android编程。 问题是我的MainActivity.java中没有“PlaceholderFragment”类。 我在这个文件中只有MainActivity类。 任何人都可以帮助我吗?MainActivity.java中没有PlaceholderFragment类
编辑: 我MainActivity.java是:
public class MainActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
请张贴代码。这是我们能够帮助你的唯一方式,并且表明了努力。我注意到你很长一段时间都是会员。请阅读教程@ http://stackoverflow.com/tour。你通过阅读获得很少的代表点。 –
你应该澄清你想要做什么。如果你只需要一个Fragemt,有很多简单的方法来做到这一点。 Android Studio可能会在过去自动添加一个名为PlaceholderFragment的Fragment。 – FlanschiFox
它存在于'MainActivityFragment.java'中,名称出现在'main_activity.xml'中 –