Here is what my Android.xml file looks like.
I am getting a force close when I am trying to run my app. I am trying
to get input from the user in number form, but I do not know the right
import or code to use to get the input.

package com.global.genname;

import android.app.Activity;
import android.os.Bundle;
import java.util.Scanner;


public class GenNameActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

     Scanner GetInput = new Scanner(System.in);
     int valueTypedIn = GetInput.nextInt();

     switch (valueTypedIn) {

     case 1:
         System.out.println("That is 1l");
         break;
     case 2:
         System.out.println("That is 2");
         break;
     default:
         System.out.println("That number is not recognized.");

     }
    }
}

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to