So I have this code and it is working. My problem is that how can I pass and show the result in new activity. I set the onclick of the 3 checkbox with selectItinerary
public class topPawikan extends ActionBarActivity {
ArrayList<String> selection = new ArrayList<String>();
TextView final_text;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.toppawikan);
final_text = (TextView)findViewById(R.id.textView);
final_text.setEnabled(false);
}
public void selectItinerary(View view){
boolean checked = ((CheckBox) view).isChecked();
switch (view.getId())
{
case R.id.checkBox1:
if (checked)
{selection.add("Maglibot");}
else
{selection.remove("Maglibot");}
break;
case R.id.checkBox2:
if (checked)
{selection.add("Kumain");}
else
{selection.remove("Kumain");}
break;
case R.id.checkBox3:
if (checked)
{selection.add("Umupo");}
else
{selection.remove("Umupo");}
break;
}
}
//button
public void finalSelection(View view){
String final_itinerary = "";
for (String Selections : selection)
{
final_itinerary = final_itinerary + Selections + "\n";
}
final_text.setText(final_itinerary);
final_text.setEnabled(true);
}
}