问题描述
1>当我加入谷歌Play服务库它显示的绿色权标记,但是当我preSS确定并重新打开项目属性,其显示的红十字会标记。
2>在Eclipse中,当我创建默认创建活动新的Android项目这其中ActionBarActivity insted的活动。为什么呢?
公共类MainActivity扩展ActionBarActivity {@覆盖
保护无效的onCreate(捆绑savedInstanceState){
super.onCreate(savedInstanceState);
的setContentView(R.layout.activity_main); 如果(savedInstanceState == NULL){
getSupportFragmentManager()调用BeginTransaction()
。新增(R.id.container,新PlaceholderFragment())提交()。
}
}@覆盖
公共布尔onCreateOptionsMenu(菜单菜单){ //充气菜单;如果是present这增加了项目操作栏。
。getMenuInflater()膨胀(R.menu.main,菜单);
返回true;
}
我得到了解决。
*拷贝的Google Play服务-lib和粘贴在其他位置。结果
*改变Eclipse工作区。结果
* Importe的Google Play服务-LIB作为现有的Android code进入工作区。浏览到新的位置,并选择谷歌播放服务-lib文件夹。结果
*转到项目属性 - > android->添加,然后选择谷歌播放服务-lib目录下。
1> When i add google play services library it shows green right mark but when i press ok and reopen project properties its showing red cross mark.
2> In eclipse when i create new android project it by default creating activity which ActionBarActivity insted of Activity. Why?
public class MainActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment()).commit();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
I got the solution
*copy google-play-services-lib and paste it in other location.
*change eclipse workspace.
* Importe google-play-services-lib as Existing Android Code Into Workspace. browse to new location and select google-play-services-lib folder.
* Goto project properties->android->Add and select google-play-services-lib.
这篇关于错误加入谷歌游戏服务,在Eclipse中的参考图书馆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!