Click here to Skip to main content
15,894,955 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
public class StoneRepot extends Activity {
	
	
	DatabaseHandler controller;
	
	static final String ITEM_NO = "Item_No";
	static final String ITEM_NAME = "Item_Name";
	static final String GR_WT = "Gross_Weight";
	static final String NE_WT = "Net_Weight";
	static final String DI_WT = "Diamond_Weight";
	static final String CS_WT = "Cs_Weight";
	static final String PRICE = "Price";

	ListView list;
	LazyAdapter adapter;
	ArrayList<string> f = new ArrayList<string>();
	File[] listFile;
	String[] mStrings;
	static String TAG = "ExelLog";

	
	
	
	
	
	ArrayList<hashmap><string,>> itemList = new ArrayList<hashmap><string,>>();


	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.stone_report);

	
	
	controller =new DatabaseHandler(this);
	itemList = controller.getAllData();
	
	Log.e("", "this is data fetchinfg in database" +itemList);
	
	list = (ListView) findViewById(R.id.list);
	adapter = new LazyAdapter(this, itemList);
	
	list.setAdapter(adapter);

	list.setOnItemClickListener(new OnItemClickListener() {

		@Override
		public void onItemClick(AdapterView				int position, long id) {

//			Intent intent = new Intent(StoneRepot.this, Custom_Dialog.class);
//
//			intent.putExtra("companyname",
//					itemList.get((int) id).get(ITEM_NAME));
//			intent.putExtra("boothnumber",
//					itemList.get((int) id).get(ITEM_NO));
//			intent.putExtra("city", itemList.get((int) id).get(GR_WT));
//			intent.putExtra("contactperson",
//					itemList.get((int) id).get(NE_WT));
//			intent.putExtra("designation", itemList.get((int) id)
//					.get(DI_WT));
//			intent.putExtra("commAddress", itemList.get((int) id)
//					.get(CS_WT));
//			intent.putExtra("pincode", itemList.get((int) id).get(PRICE));
//
//			startActivity(intent);

		}
	});
}
	@Override
	public void onDestroy() {
		list.setAdapter(null);
		super.onDestroy();
	}

	}
------------------------------------------
stone_report.xml



<linearlayout xmlns:android="http://schemas.android.com/apk/res/android">
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <linearlayout>
        android:id="@+id/upper"
        android:layout_width="fill_parent"
        android:layout_height="10dip"
        android:layout_weight="0.10"
        android:removed="#d5ddee"
        android:orientation="horizontal"
        android:paddingTop="5dip" >
        
        <textview>
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:gravity="center"
            
            android:paddingTop="10dip"
            android:text="Items"/>
        
    </textview></linearlayout>

    <tablelayout>
        android:id="@+id/entry"
        android:layout_width="fill_parent"
        android:layout_height="10dip"
        android:layout_weight="0.06" >

        <tablerow>

            <textview>
                android:id="@+id/name1"
                android:layout_width="fill_parent"
                android:layout_height="wrap_removed"
                android:layout_weight="0.25"
                android:text="Item Name"
                android:textAppearance="?android:attr/textAppearanceSmallInverse"
                android:textColor="#43bd00"
                android:textStyle="bold" />

            <textview>
                android:id="@+id/name2"
                android:layout_width="fill_parent"
                android:layout_height="wrap_removed"
                android:layout_weight="0.15"
                android:text="Gross Wt"
                android:textAppearance="?android:attr/textAppearanceSmallInverse"
                android:textColor="#43bd00"
                android:textStyle="bold" />

            <textview>
                android:id="@+id/name3"
                android:layout_width="fill_parent"
                android:layout_height="wrap_removed"
                android:layout_weight="0.25"
                android:text="Net Wt"
                android:textAppearance="?android:attr/textAppearanceSmallInverse"
                android:textColor="#43bd00"
                android:textStyle="bold" />

            <textview>
                android:id="@+id/name4"
                android:layout_width="fill_parent"
                android:layout_height="wrap_removed"
                android:layout_weight="0.25"
                android:text="Diamond Wt"
                android:textAppearance="?android:attr/textAppearanceSmallInverse"
                android:textColor="#43bd00"
                android:textStyle="bold" />

            <textview>
                android:id="@+id/name5"
                android:layout_width="fill_parent"
                android:layout_height="wrap_removed"
                android:layout_weight="0.10"
                android:text="CS Wt"
                android:textAppearance="?android:attr/textAppearanceSmallInverse"
                android:textColor="#43bd00"
                android:textStyle="bold" />
        </textview></textview></textview></textview></textview></tablerow>

        <tablerow>
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="0dip" >

            <view>
                android:id="@+id/line1"
                android:layout_width="match_parent"
                android:layout_height="1dip"
                android:layout_weight="1"
                android:removed="#FF909090" />
            
        </view></tablerow>
    </tablelayout>
    

    
    <linearlayout>
        android:id="@+id/navigation"
        android:layout_width="fill_parent"
        android:layout_height="0dip"
        android:layout_weight="0.74"
        android:removed="#d5ddee"
        android:orientation="horizontal" >

        <listview>
            android:id="@+id/list"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
             />

        
    </listview></linearlayout>
</linearlayout></hashmap></hashmap>
Posted
Updated 18-Apr-14 7:36am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900