ArrayList <Item > items = new ArrayList <Item >();
private EntryAdapter adapter;
private SharedPreferences preference;
private int usernameKe;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceS tate);
preference = getSharedPreferences("prefere nce", Context.MODE_PRIVATE);
(to be continue...)
(continue)
items.add(new SectionItem("Pengaturan PIN"));
items.add(new EntryItem("Ubah PIN",
"Masukkan PIN Anda yang baru di sini"));
items.add(new SectionItem("Pilihan Nomor Tujuan Pengiriman"));
items.add(new EntryItem("IM3", "085741222225"));
items.add(new EntryItem("AS", "082372423333"));
items.add(new EntryItem("XL", "081915348000"));
items.add(new EntryItem("3", "08986903333"));
items.add(new SectionItem("Pengelolaan User ID"));
items.add(new EntryItem("Tambah ID", "Masukkan User ID baru"));
int jumlahUsername = Integer.parseInt(preference.g etString(
"jumlah_userid", "0"));
if (jumlahUsername >= 1) {
for (int i = 1; i <= jumlahUsername; i++) {
String nilaiDitampilkan = preference.getString("u" + i, "");
items.add(new EntryItem(nilaiDitampilkan, ""));
}
}
/ / Toast.makeText(this, jumlahUsername + "", Toast.LENGTH_SHORT).show();
int nomorTerpilih = preference.getInt("nomor", 0);
adapter = new EntryAdapter(QuickPrefsActivi ty.this, this, items,
nomorTerpilih);
setListAdapter(adapter);
}
@Override
protected void onListItemClick(ListView l, View v, int selectedPosition,
long id) {
if (!items.get(selectedPosition) .isSection()) {
RadioButton radioButton = (RadioButton) v
.findViewById(selectedPositio n);
((MyApplication) getApplication())
.setSomeVariable(selectedPosi tion);
Editor editorPage = preference.edit();
editorPage.putInt("nomor", selectedPosition);
editorPage.commit();
switch (selectedPosition) {
case 1:
showDialog(0);
break;
case 3:
radioButton.setChecked(true);
break;
case 4:
radioButton.setChecked(true);
break;
case 5:
radioButton.setChecked(true);
break;
case 6:
radioButton.setChecked(true);
break;
case 8:
showDialog(1);
}
adapter.notifyDataSetInvalida ted();
}
super.onListItemClick(l, v, selectedPosition, id);
}
@Override
protected Dialog onCreateDialog(int id) {
Dialog dialog = null;
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYO UT_INFLATER_SERVICE);
final View layout = inflater.inflate(R.layout.uba h_pin_dialog,
(ViewGroup) findViewById(R.id.ubahPinLayo ut));
final TextView textView = (TextView) layout
.findViewById(R.id.upahPinTex tView);
textView.setGravity(Gravity.C ENTER);
final EditText editText = (EditText) layout
.findViewById(R.id.pinEditTex t);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setView(layout);
if (id == 0) {
String pin = preference.getString("PIN", "");
textView.setText("Masukkan PIN Anda yang baru di sini");
editText.setText(pin);
editText.setInputType(InputTy pe.TYPE_CLASS_NUMBER);
builder.setTitle("Ubah PIN");
builder.setPositiveButton("Ub ah",
new DialogInterface.OnClickListen er() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
String pinDisimpan = editText.getText().toString() ;
if (pinDisimpan.length() == 4) {
SharedPreferences pinPreference = getSharedPreferences(
"preference", Context.MODE_PRIVATE);
Editor editorPage = pinPreference.edit();
editorPage.putString("PIN",
pinDisimpan.toString());
editorPage.commit();
} else {
Toast.makeText(getApplication Context(),
"GAGAL: PIN tidak valid",
Toast.LENGTH_SHORT).show();
}
}
});
builder.setNegativeButton("Ba tal",
new DialogInterface.OnClickListen er() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
}
});
final AlertDialog pinDialog = builder.create();
dialog = pinDialog;
} else {
textView.setText("Masukkan username Anda yang baru di sini");
editText.setText("");
builder.setView(layout);
builder.setTitle("User ID");
builder.setPositiveButton("Ta mbah",
new DialogInterface.OnClickListen er() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
usernameKe = items.size() - 8;
String size = String.valueOf(usernameKe);
String nilaiDisimpan = editText.getText()
.toString();
preference = getSharedPreferences("prefere nce",
Context.MODE_PRIVATE);
Editor editorPage = preference.edit();
editorPage.putString("u" + size, nilaiDisimpan);
editorPage.putString("jumlah_ userid", size);
editorPage.commit();
Toast.makeText(getApplication Context(),
Integer.parseInt(size) + "",
Toast.LENGTH_SHORT).show();
items.add(new EntryItem(nilaiDisimpan, ""));
adapter.notifyDataSetChanged( );
}
});
builder.setNegativeButton("Ba tal",
new DialogInterface.OnClickListen er() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
}
});
final AlertDialog pinDialog = builder.create();
dialog = pinDialog;
}
return dialog;
}
switch (selectedPosition) {
case 1:
showDialog(0);
break;
case 3:
radioButton.setChecked(true);
adapter.notifyDataSetInvalida ted();
break;
case 4:
radioButton.setChecked(true);
adapter.notifyDataSetInvalida ted();
break;
case 5:
radioButton.setChecked(true);
adapter.notifyDataSetInvalida ted();
break;
case 6:
radioButton.setChecked(true);
adapter.notifyDataSetInvalida ted();
break;
case 8:
showDialog(1);
}
private EntryAdapter adapter;
private SharedPreferences preference;
private int usernameKe;
@Override
public void onCreate(Bundle savedInstanceState) {
(to be continue...)
}
@Override
protected void onListItemClick(ListView l, View v, int selectedPosition,
}
@Override
protected Dialog onCreateDialog(int id) {
}
switch (selectedPosition) {
Date: 2012-11-04 01:58:04 and last modified: 2012-11-04 01:58:04
Relate posts:
- professional builder 2012 11 rar
- meboy builder 2 2 jar
- ehtml5 builder part1 rar
- pkg builder rar
- crack family tree builder exe
- a4desk flash website builder exe
- demo builder v5 1 by everth21 rar
- download c builder 4 zip
- etboot builder rar
- builder hardbeat market mp3
- hand knitted bags small items rar
- 15 0 0 24 hidden items zip
- [checkedListBox1,Items] for (int x = 0; x < checkedListBox1.Items.Count; x++) { if
- [collection,items] exports.findAll = function(req, res) { db.collection('temp',
- [item,items] function anotherCounty(){ var newCounty = document.forms
- [items,NSDictionary] for (int i=0; i<= [urls count]-1; i++) { self.items
- [catalog,items] catalog_items
- [Items] private void btnSubstring_Click(object sender, EventArgs e)
- [Items,Faire] Darkmoon Faire Items TradeSkillMaster Importable Shopping Li
- [item,items] <a href="http://localhost/pyrocms/upload/2_LBergereChairWU2
Recent posts:
- va sexy movies 2010 hg team rar
- hatchi v2 50b apk
- finding hope when life overwhelms you
- boney m baby do you wanna bump mp3
- caprice hardcore tricks xxx 1080p wmv
- heyzo 174 hd rar
- yumi kazama 58 japanese beauties avi
- lick her ass juice off my cock avi
- sound horizon roman rar
- very sexy blondes enjoying life avi