本文介绍了为什么'hello world'不能在android模拟器中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 在我的app项目中,我的模拟器没有'hello world'。 我能看到时钟和其他设置,但不能看到我的应用程序的'hello world'。 任何人都可以帮帮我吗? < ; 资源 > < string name = app_name > 我的应用程序< / string > < string name = hello_world > Hello world!< / string > < string 姓名 = action_settings > 设置< / string > < string 名称 = title_activity_main > MainActivity < / string > < ; / resources > package com.example.rajendran.myapplication; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.app.Activity; import android.support.v4.app.NavUtils; public class MainActivity extends 活动{ @覆盖 受保护 void onCreate(Bundle savedInstanceState){ super .onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @覆盖 public boolean onCreateOptionsMenu(菜单菜单){ // 膨胀菜单;如果项目存在,则会将项目添加到操作栏。 getMenuInflater()。inflate(R.menu.menu_main,menu); 返回 true; } } < relativelayout xmlns:android = http:// schemas .android.com / apk / res / android > xmlns:tools =http://schemas.android.com/工具 android:layout_width =match_parent android:layout_height =match_parent> < textview > ; android:layout_width =wrap_content android:layout_height =wrap_content android:layout_centerHorizo​​ntal =true android:layout_centerVertical =true android:text =@ string / hello_world tools:context =。MainActivity/> < / textview > < / relativelayout > 解决方案 Quote: 使用鼠标滑动并单击(触摸)AVD,而不是使用手指。将钥匙锁符号一直向左滑动,直至解锁屏幕,回到家中,翻阅菜单,直到找到名为的绿色机器人图标 请参阅创建简单的Hello World Android项目中的图12 [ ^ In my app project my emulator appears without 'hello world'.I am able to see the clock and other settings but not my app's 'hello world'.Can anyone help me out?<resources> <string name="app_name">My Application</string> <string name="hello_world">Hello world!</string> <string name="action_settings">Settings</string> <string name="title_activity_main">MainActivity</string></resources>package com.example.rajendran.myapplication;import android.os.Bundle;import android.view.Menu;import android.view.MenuItem;import android.app.Activity;import android.support.v4.app.NavUtils;public class MainActivity extends Activity { @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; }}<relativelayout xmlns:android="http://schemas.android.com/apk/res/android"> xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <textview> android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:text="@string/hello_world" tools:context=".MainActivity" /> </textview></relativelayout> 解决方案 Quote:Instead of using your finger, use your mouse to swipe and click (touch) on the AVD. Swipe the key lock symbol all the way to the left until it is out of the way to unlock the screen, go to home, flip through the menu, until you find this green robot icon calledRefer to Figure 12 in Creating a Simple Hello World Android Project[^] 这篇关于为什么'hello world'不能在android模拟器中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-05 19:46
查看更多