01.
public
class
PurchaseOrderActivity
extends
AppCompatActivity {
02.
03.
@Override
04.
protected
void
onCreate(Bundle savedInstanceState) {
05.
super
.onCreate(savedInstanceState);
06.
getSupportActionBar().hide();
07.
setContentView(R.layout.activity_purchase_order);
08.
09.
10.
11.
Bundle bundle = getIntent().getExtras();
12.
String txtProductID = bundle.getString(
"ProductID"
);
13.
String txtName = bundle.getString(
"Name"
);
14.
double
Price = bundle.getDouble(
"Price"
);
15.
double
Num = bundle.getDouble(
"Num"
);
16.
double
Val = bundle.getDouble(
"Val"
);
17.
Integer count=bundle.getInt(
"Count"
);
18.
19.
ArrayList<HashMap<String, String>> MyArrList =
new
ArrayList<HashMap<String, String>>();
20.
HashMap<String, String> map;
21.
map =
new
HashMap<>();
22.
map.put(
"ProductID"
, txtProductID);
23.
map.put(
"Name"
, txtName);
24.
map.put(
"Price"
, Double.toString(Price));
25.
map.put(
"Num"
, Double.toString(Num));
26.
map.put(
"Val"
, Double.toString(Val));
27.
MyArrList.add(map);
28.
29.
30.
final
ListView listView1 = (ListView) findViewById(R.id.listView1);
31.
SimpleAdapter sAdap;
32.
33.
sAdap =
new
SimpleAdapter(PurchaseOrderActivity.
this
, MyArrList, R.layout.activity_column_po,
34.
new
String[] {
"ProductID"
,
"Name"
,
"Price"
,
"Num"
,
"Val"
},
new
int
[]{R.id.ColProductID, R.id.ColName, R.id.ColPrice, R.id.ColNum, R.id.ColVal});
35.
listView1.setAdapter(sAdap);
36.
37.
38.
Button btnCancel = (Button)findViewById(R.id.btnCancel);
39.
btnCancel.setOnClickListener(
new
View.OnClickListener() {
40.
@Override
41.
public
void
onClick(View v) {
42.
finish();
43.
}
44.
});
45.
46.
47.
}
48.
}