Emulator issue

  • Replies:2
  • OpenNot stickiedUnanswered

Apr 17, 2014 10:18:51 AM via Website

hi i am very new to Android Development. I tried to execute the following program in Android Developer Tools

***public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

    TextView text = new TextView(this);
    text.setText("Hello World, Android - mkyong.com");
    setContentView(text);
}

}*

AVD details are below

image

i am facing the following issue

*

[2014-04-17 12:29:30 - Emulator] NAND: nand_dev_load_disk_state ftruncate failed: Invalid argument [2014-04-17 12:29:30 - Emulator] savevm: unable to load section nand_dev [2014-04-17 12:30:45 - AndroidProc] emulator-5554 disconnected! Cancelling 'com.example.androidproc.MainActivity activity launch'!

*

i googled through but was unable to get satisfactory answer.

Please help me to solve the problem

regards Gautam

Sep 16, 2014 10:28:28 PM via Website

Think your problem is in setContentView(text);

That is normally not the best way to do it. Typically you make an XML file which contains the layout and reference to that. I am not sure if you can set a setContentView to a textview directly...

Maybe best to check the google developer forum, they have a great tutorial on how to start with programming for Android devices.

Good luck.