I am a complete newb and know nothing. I'm probably very inefficient at what I have already, but that's the learning curve. I'm making an Android app, using Eclipse to do it.
The app will have 3 screens. On the first two screen is a list of buttons. The user taps on the buttons that apply to the situation and then that button disappears from that screen and appears on screen 3. Screen 2 is the same as screen 1 but with a separate list (selection still mixes with screen 3).
I am setting up screen one, am typing out many, many strings (it's a long list) in my strings.xml. Let's assume it's a shopping list program. The strings are set up like:
<string name="vc002">Bread</string>
<string name="vc003">Butter</string>
And so on. Layout is like this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/v001"
android:layout_gravity="center"
/>
<Button
android:id="@+id/vb01"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_gravity="center"
android:text="@string/vc001"
/>
<Button
android:id="@+id/vb02"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_gravity="center"
android:text="@string/vc002"
/>
And this is the following Activity, screen 1:
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class VenialListActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final Button vb01 = (Button)findViewById(R.id.vb01);
vb01.setOnClickListener(new View.OnClickListener() {
public void onClick(View v){
vb01.setVisibility(View.INVISIBLE);
};
;
}
);
}
}
And now I'm stuck. The button disappears as expected but I don't know how to make it appear on screen 3. Similarly, I'd like to be able to tap a button on screen 3 (in case of a mistap) and send it back home and make it visible again.
Anyone able to help me out? I apologise if I have broken any site rules or if I give someone a headache with my newbness. I don't exactly know what the above is actually doing, I just know that it works so I shouldn't break it. It's like learning Latin or Greek or Dvorak typing. It's bound to be slow going and I'm going to make more mistakes than not. Regardless, I do thank you for your time and patience if you've made it this far. =)