System.out.println("Hello World!");
不打印屏幕上的任何東西。它可以在Consol上看到。我嘗試了下面的代碼,併爲我工作得很好。
//主要活動 公共類MainActivity擴展活動{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.kuchbhi);
System.out.println("Hello World!");
}
佈局/.xml
<LinearLayout 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"
android:orientation="horizontal" >
<EditText android:id="@+id/text_message"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="enter text" />
<Button android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Send" />
</LinearLayout>
清單文件..
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name="MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
試試這個代碼,讓我知道你所看到的。
我想你的源代碼,這是對我工作的罰款。見屏幕
