Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- As you can see I am composing an arraylist based on which checkboxes are flagged. If I check Checkbox1 it adds the String "newString".
- Then, I convert the ArrayList to a String ("X").
- Lastly, I create the finish method and set "result" as the string X.
- Still I get the error from:
- -String X = builder.toString().replace("[", "").replace("]", ""); -builder(the Arraylist) is highlighted
- -returnIntent.putExtra("result", String.X); -"X" comes as an error-
- public class Popup1 extends Activity {
- private TextView textViewResult;
- public String newString;
- public String bestemmia;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.popup3);
- textViewResult = (TextView) findViewById(R.id.textViewResult);
- final ArrayList<String> builder = new ArrayList<String>();
- final CheckBox checkBox1 = (CheckBox) findViewById(R.id.checkBox);
- checkBox1.setChecked(false);
- (...........)
- if (checkBox1.isChecked()) {
- builder.add((String.valueOf(newString)));
- builder.add("\n");
- } else {
- builder.remove(String.valueOf(newString));
- builder.remove("\n");
- }
- }
- });
- getData();
- }
- private void getData() {
- (..............)codingcoding
- }
- (coding)
- String newString= (String)(.................).toString();
- (..............)
- }
- String X = builder.toString().replace("[", "").replace("]", "");
- @Override
- public void finish() {
- // Prepare data intent
- Intent returnIntent = new Intent();
- returnIntent.putExtra("result", String.X);
- setResult(Activity.RESULT_OK, returnIntent);
- super.finish();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement