Need help white adding items

2 replies [Last post]
sitav1kat
User offline. Last seen 1 year 22 weeks ago. Offline
Joined: 09/01/2010

Can somebody say whats wrong whit my code. When I add item in to a list in application, It wont come there. And if I click somewhere else in android application couple of times, then show added "item" sometimes.

This is my code:

package com.example.proov;

import java.util.ArrayList;

import com.example.proov.R;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;

public class proovin extends Activity {
private ListView LView;

ArrayList ar = new ArrayList();

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
LView = (ListView) findViewById(R.id.ListView01);
// Set option as Multiple Choice. So that user can able to select more the one option
LView.setAdapter(new ArrayAdapter(this,
android.R.layout.simple_list_item_multiple_choice, ar));
LView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);

Button b = (Button) findViewById(R.id.add_item);
final EditText d = (EditText) findViewById(R.id.title);
b.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
ar.add(d.getText().toString());

}
});
}
}

1xuntong
User offline. Last seen 5 weeks 6 days ago. Offline
Joined: 12/25/2011
miu miu

prada bags discount gently move, who place constantly. Make the eyes of tentacles, birds, plants must be leaves, branches of the image is clear, these figures are remarkably true. Wear it on the head, no doubt, will increase a JiaoTai beautiful appearance.

pandorauk
User offline. Last seen 1 year 8 weeks ago. Offline
Joined: 12/07/2010
Way back in Pandora I was

Way back in Pandora I was approached by Sid’s mother to do a book about Sid Vicious, obviously. With Pandora Bracelets crystal ball in one hand