SMS Bomber Android (Work 100%)
Software ini cocok untuk anda yang suka iseng ..Yuuk langsung aja di download :-)

Download Juga Anti-Sms Bomber


HAHAHAHA Start BOmbing!!!!
Software ini cocok untuk anda yang suka iseng ..


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
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_id="@+id/txt"
/>
<ListView
android_layout_width="wrap_content"
android_layout_height="wrap_content"
android_id="@+id/List"
/>
</LinearLayout>
final String [] items=new String[]{"Item1","Item2","Item3","Item4"};
ArrayAdapter ad=new ArrayAdapter(this,android.R.layout.simple_list_item_1,items);
list=(ListView)findViewById(R.id.List);
list.setAdapter(ad);
list.setOnItemClickListener(new OnItemClickListener()
{
public void onItemClick(AdapterView arg0, View arg1, int arg2,
long arg3) {
// TODO Auto-generated method stub
TextView txt=(TextView)findViewById(R.id.txt);
txt.setText(list.getItemAtPosition(arg2).toString());
}
}
);
The above code displays the selected item text in the textview:public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.main);
final String [] items=new String[]{"Item1","Item2","Item3","Item4"};
ArrayAdapter ad=new ArrayAdapter(this,android.R.layout.simple_list_item_multiple_choice,items);
setListAdapter(ad);
ListView list=getListView();
list.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
}
Now suppose you want to change the text of the an item when it is clicked, you can do it like this:list.setOnItemClickListener(new OnItemClickListener()Or a more neat way:
{
public void onItemClick(AdapterView arg0, View arg1, int arg2,
long arg3) {
// TODO Auto-generated method stub
TextView txt=(TextView)findViewById(R.id.txt);
items[arg2]="changed";
list.setAdapter(new ArrayAdapter(ListControls.this,android.R.layout.simple_list_item_1,items));
}
}
);
list.setOnItemClickListener(new OnItemClickListener()See that you actually change the value of the string array item at the selected position then bind the listview with the adapter again. Or you capture the View object and do what you want.
{
public void onItemClick(AdapterView arg0, View arg1, int arg2,
long arg3) {
// TODO Auto-generated method stub
TextView temp=(TextView)arg1;
temp.setText("changed 2");
}
}
);
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final String [] items=new String[]{"Item1","Item2","Item3","Item4"};
ArrayAdapter ad=new ArrayAdapter(this,android.R.layout.simple_list_item_1,items);
setListAdapter(ad);
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
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_id="@+id/txt"
android_text="List View Demo"
/>
<ListView
android_layout_width="fill_parent"
android_layout_height="wrap_content"
android_id="@android:id/list"
/>
</LinearLayout>
Copyright © 2009 Gadget Review. Powered by Blogger..
Blogger Templates created by Deluxe Templates