इम बहुत ही इस एंड्रॉयड development.I सिर्फ एक हैलो दुनिया आवेदन बनाने के लिए शुरू कर दिया करने के लिए नए में एक पृष्ठभूमि छवि स्थापित करने के लिए।कैसे एंड्रॉयड
मैं एक पृष्ठभूमि छवि स्थापित करने के लिए करने की कोशिश की और यह काम कर रहा है fine.When मैं छवि यह काम नहीं कर रहा है पर एक पाठ जोड़ने की कोशिश की।
मैं रास्ते में करने की कोशिश की below.Can किसी कृपया मेरी मदद जहां im गलत हो रहा।
Main.xml<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@drawable/andriod"
android:layout_gravity="center_vertical"
android:gravity="center_vertical">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
</LinearLayout>
HelloActivity.java
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
//import android.widget.ImageView;
public class HelloActivity extends Activity {
// /** Called when the activity is first created. */
// @Override
// public void onCreate(Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
// setContentView(R.layout.main);
// }
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
tv.setText("This is the first andorid app");
setContentView(R.layout.main);
}
}
जब चल रहा है यह पृष्ठभूमि छवि दिखा रहा है लेकिन नहीं दिखा रहा है "यह पहली Andorid अनुप्रयोग है" में
।
आपकी मदद के लिए आशा
@ishhhh: आप TextView टीवी में पाठ सेट कर रहे हैं, लेकिन लेआउट में इस टीवी को जोड़ने नहीं। – Mudassir