I only have a simple layout with some inputs and text view...
I initialize them with the attribute: android:visibility="invisible"
and i show them on the screen as they are needed...
when i take out the keyboard to write on the inputs the app shows an unexpected error and finish the app...
NO other screen gives this error...
ANY IDEAS?!?!?!
here some of my code:
Code:
Using java Syntax Highlighting
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.verify);
- mTitle = (TextView) findViewById(R.id.info);
- //Initialize variables, Cell number and imei
- mTelephonyMgr = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
- imei = mTelephonyMgr.getDeviceId();
- phoneNum = mTelephonyMgr.getLine1Number();
- verification_code="";
- ...
- //initialize button for verifying
- button = (Button) findViewById(R.id.verify);
- setButton();
- //initialize the verification process;
- initialize();
- }
- public void initialize(){
- int readResult = readSettings();
- switch(readResult){
- case(0):
- ...
- showInputs();
- break;
- case(1):
- ...
- }
- }
- public void setButton(){
- button.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- mTitle.setText("Plase wait...");
- if( verifyInputs() == true)
- {
- vcode.setVisibility(View.INVISIBLE);
- vcode_input.setVisibility(View.INVISIBLE);
- phone.setVisibility(View.INVISIBLE);
- phone_input.setVisibility(View.INVISIBLE);
- button.setVisibility(View.INVISIBLE);
- ....
- if(response.equals("No"))
- {
- ...
- }
- else if(response.equals("Yes"))
- {
- ....
- }
- else{
- ....
- }
- }
- }
- });
- }
- public void showInputs(){
- vcode = (TextView)findViewById(R.id.vcode);
- vcode_input = (EditText)findViewById(R.id.vcode_input);
- phone = (TextView)findViewById(R.id.phone);
- phone_input = (EditText)findViewById(R.id.phone_input);
- vcode.setVisibility(View.VISIBLE);
- vcode_input.setVisibility(View.VISIBLE);
- if (phoneNum.equals(""))
- {
- phone.setVisibility(View.VISIBLE);
- phone_input.setVisibility(View.VISIBLE);
- }
- button.setVisibility(View.VISIBLE);
- }
Parsed in 0.040 seconds, using GeSHi 1.0.8.4
Layout XML:
Using xml Syntax Highlighting
- <?xml version="1.0" encoding="utf-8"?>
- <TableLayout
- android:id="@+id/widget0"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical"
- xmlns:android="http://schemas.android.com/apk/res/android"
- >
- <ScrollView
- android:id="@+id/widget72"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- >
- <TableLayout
- android:id="@+id/widget28"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:background="#ffffffff"
- android:padding="30px"
- android:orientation="vertical"
- android:stretchColumns="1"
- >
- <TableRow
- android:id="@+id/widget29"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- >
- <TextView
- android:id="@+id/widget30"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:padding="10px"
- android:text="Verifying your cell phone."
- android:textSize="18sp"
- android:textStyle="bold"
- android:textColor="#ff333333"
- >
- </TextView>
- </TableRow>
- <TableRow
- android:id="@+id/widget30"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- >
- <TextView
- android:id="@+id/info"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:textColor="#ff000099"
- android:text="Please wait..."
- android:padding="10px"
- >
- </TextView>
- </TableRow>
- <TableRow
- android:id="@+id/widget31"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- >
- <TextView
- android:id="@+id/vcode"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:textColor="#ff333333"
- android:text="Verification Code:"
- android:textStyle="bold"
- android:padding="10px"
- android:visibility="invisible"
- >
- </TextView>
- </TableRow>
- <TableRow
- android:id="@+id/widget33"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- >
- <EditText
- android:id="@+id/vcode_input"
- android:layout_width="30px"
- android:layout_height="40px"
- android:visibility="invisible"
- android:numeric="integer"
- >
- </EditText>
- </TableRow>
- <TableRow
- android:id="@+id/widget35"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- >
- <TextView
- android:id="@+id/phone"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:textColor="#ff333333"
- android:text="Cell Phone:"
- android:textStyle="bold"
- android:padding="10px"
- android:visibility="invisible"
- >
- </TextView>
- </TableRow>
- <TableRow
- android:id="@+id/widget37"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- >
- <EditText
- android:id="@+id/phone_input"
- android:layout_width="30px"
- android:layout_height="40px"
- android:visibility="invisible"
- android:numeric="integer"
- >
- </EditText>
- </TableRow>
- <TableRow
- android:id="@+id/widget915"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- >
- <Button
- android:id="@+id/verify"
- android:layout_width="100px"
- android:layout_height="50px"
- android:layout_marginLeft="70px"
- android:layout_marginRight="70px"
- android:text="Verify"
- android:textColor="#ff666666"
- android:visibility="invisible"
- >
- </Button>
- </TableRow>
- </TableLayout>
- </ScrollView>
- </TableLayout>
Parsed in 0.014 seconds, using GeSHi 1.0.8.4
Manifest:
Using xml Syntax Highlighting
- <?xml version="1.0" encoding="utf-8"?>
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.mobile.social.net"
- android:versionCode="1"
- android:versionName="1.0.0">
- <uses-permission android:name="android.permission.INTERNET" />
- <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
- <application android:icon="@drawable/icon" android:label="@string/app_name">
- <activity android:name="verification"
- android:label="Verifying">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- <activity android:name="main_screen" android:launchMode="singleInstance" android:label="MobileSocialNet">
- </activity>
- <activity android:name="ListFriends" android:launchMode="singleInstance" android:label="My Friends">
- </activity>
- <activity android:name="WallMessage" android:launchMode="singleInstance" android:label="Wall Message">
- </activity>
- </application>
- </manifest>
Parsed in 0.005 seconds, using GeSHi 1.0.8.4



