Reverting AVD state?


Last Updated:

  1. qoncept

    qoncept Member This Topic's Starter

    Joined:
    Nov 8, 2009
    Messages:
    18
    Likes Received:
    0
    I just toyed with the SDK for the first time last night. I have the latest version of the SDK, Eclipse 3.5 and everything all set up and ready to go. I was working through the hello world example to get a feel for it and found that the second time I ran the app, the AVD didn't behave the same way as it did the first time at all, and my changes weren't being reflected. After the first time I ran my app, the AVD would start locked and then show the hello world app as it was compiled the first time I ran it. What am I doing wrong.

    I also want to say I don't have a clue how I'd search for this, so if it's been discussed, sorry! Thanks for the help!
     

    Advertisement
  2. metter

    metter Active Member

    Joined:
    Oct 19, 2009
    Messages:
    33
    Likes Received:
    0
    Hello qoncept

    I am not quite sure I understood your problem.
    So you made changes to the code and ran it, but it showed like the first time you ran it? If so:

    this.setContentView(R.layout.main); This loads the layout defined in main.xml (which contains a TextView that shows "Hello World"). Have you maybe forgotten to remove / change this?

    If you have; Restart the emulator and eclipse and see if it works now. Check the console for hints on what might go wrong (The app may not be getting reinstalled).

    Try to remove the app using the emulators Settings->Applications Menu. Then run it again from eclipse.

    Hope that helps.
    Cheers
     
  3. qoncept

    qoncept Member This Topic's Starter

    Joined:
    Nov 8, 2009
    Messages:
    18
    Likes Received:
    0
    Well, I started over because no matter what it wouldn't show my changes.. and now whats happening doesn't make any sense at all to me.

    Hello.java (main activity):
    Code (Text):
    1. package com.newrage.hello;
    2.  
    3. import android.app.Activity;
    4. import android.os.Bundle;
    5.  
    6. public class Hello extends Activity {
    7.     /** Called when the activity is first created. */
    8.     @Override
    9.     public void onCreate(Bundle savedInstanceState) {
    10.         super.onCreate(savedInstanceState);
    11.         setContentView(R.layout.main);
    12.     }
    13. }
    main.xml
    Code (Text):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <TextView xmlns:android="http://schemas.android.com/apk/res/android"
    3.   android:layout_width="fill_parent"
    4.   android:layout_height="fill_parent"
    5.   android:text="@string/hello"/>
    strings.xml
    Code (Text):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <resources>
    3.     <string name="hello">Hello, Android! I am a string resource!</string>
    4.     <string name="app_name">Hello, Android</string>
    5. </resources>
    6.  
    The output should be "Hello, Android" as the app title and "Hello, Android! I am a string resource!". Right?!

    For some reason, it's displaying "Hello World, Hello!" I don't have a clue where that's coming from or why.
     
  4. qoncept

    qoncept Member This Topic's Starter

    Joined:
    Nov 8, 2009
    Messages:
    18
    Likes Received:
    0
    Well, I did some more playing and apparently somehow I made changes in the filesystem outside of Eclipse and it wasn't showing them, even after I quit and reopened it. Then it magically did. Dumb mistake, but not my first. Now, to make something useful. :)
     
  5. metter

    metter Active Member

    Joined:
    Oct 19, 2009
    Messages:
    33
    Likes Received:
    0
    Hehe ok.

    Have fun then :)
     

Share This Page

Loading...