<file_sep>package view.product.list;



import java.util.ArrayList;
import java.util.HashMap;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;
import com.bukalapakmobile.R;
public class MyLapakListView extends Activity {
	// All static variables
	static final String KEY_NAME = "song"; // parent node
	static final String KEY_STATUS = "id";
	static final String KEY_STOCK = "title";
	static final String KEY_PRICE = "artist";
	
	ListView listLapak;
    MyLapakAdapter adapter;
    
    @Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.view_product_list_main);
		

		ArrayList<HashMap<String, String>> productList = new ArrayList<HashMap<String, String>>();

		// looping through all product list
		/*
		for (int i = 0; i < nl.getLength(); i++) {
			// creating new HashMap
			HashMap<String, String> map = new HashMap<String, String>();
			Element e = (Element) nl.item(i);
			// adding each child node to HashMap key => value
			map.put(KEY_NAME, parser.getValue(e, KEY_ID));
			map.put(KEY_STATUS, parser.getValue(e, KEY_TITLE));
			map.put(KEY_STOCK, parser.getValue(e, KEY_ARTIST));
			map.put(KEY_PRICE, parser.getValue(e, KEY_DURATION));

			// adding HashList to ArrayList
			productList.add(map);
		}*/
		

		listLapak=(ListView)findViewById(R.id.list_mylapak);
		
		// Getting adapter by passing xml data ArrayList
        adapter=new MyLapakAdapter(this, productList);        
        listLapak.setAdapter(adapter);
        

        // Click event for single list row
        listLapak.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> parent, View view,
					int position, long id) {
							

			}
		});		
	}
}
<file_sep>bukalapakmobile
===============

Ini versi mobile dan single source
<file_sep>package view.home;

import com.bukalapakmobile.R;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;

public class Dashboard2 extends BaseHeader {

    private ListView listView1;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dashboard_layout);
        
        DashboardItem dashboard_data[] = new DashboardItem[]
        {
            new DashboardItem(R.drawable.home, "Jual Barang"),
            new DashboardItem(R.drawable.home, "My Lapak"),
            new DashboardItem(R.drawable.home, "Transaksi"),
            new DashboardItem(R.drawable.home, "Pesan")
        };
        /*
        DashboardAdapter adapter = new DashboardAdapter(this, 
                R.layout.listview_item_row, dashboard_data);
        
        
        listView1 = (ListView)findViewById(R.id.listView1);
        
        View header = (View)getLayoutInflater().inflate(R.layout.listview_header_row, null);
        listView1.addHeaderView(header);
        
        setHeader();
        
        listView1.setAdapter(adapter);
        */
    }
}<file_sep>package view.product.list;
 
import java.util.HashMap;
 
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTransaction;
import android.view.View;
import android.widget.TabHost;
import android.widget.TabHost.TabContentFactory;
 
import com.bukalapakmobile.*;
 
/**
 * @author mwho
 *
 */
public class Tab_MyLapak extends FragmentActivity implements TabHost.OnTabChangeListener {
 
    private TabHost mTabHost;
    private HashMap mapTabInfo = new HashMap();
    private TabInfo mLastTab = null;
 
    private class TabInfo {
         private String tag;
         private Class clss;
         private Bundle args;
         private Fragment fragment;
         TabInfo(String tag, Class clazz, Bundle args) {
             this.tag = tag;
             this.clss = clazz;
             this.args = args;
         }
 
    }
 
    class TabFactory implements TabContentFactory {
 
        private final Context mContext;
 
        /**
         * @param context
         */
        public TabFactory(Context context) {
            mContext = context;
        }
 
        /** (non-Javadoc)
         * @see android.widget.TabHost.TabContentFactory#createTabContent(java.lang.String)
         */
        public View createTabContent(String tag) {
            View v = new View(mContext);
            v.setMinimumWidth(0);
            v.setMinimumHeight(0);
            return v;
        }
 
    }
    /** (non-Javadoc)
     * @see android.support.v4.app.FragmentActivity#onCreate(android.os.Bundle)
     */
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // Step 1: Inflate layout
        setContentView(R.layout.main_tab);
        // Step 2: Setup TabHost
        initialiseTabHost(savedInstanceState);
        if (savedInstanceState != null) {
            mTabHost.setCurrentTabByTag(savedInstanceState.getString("tab")); //set the tab as per the saved state
        }
    }
 
    /** (non-Javadoc)
     * @see android.support.v4.app.FragmentActivity#onSaveInstanceState(android.os.Bundle)
     */
    protected void onSaveInstanceState(Bundle outState) {
        outState.putString("tab", mTabHost.getCurrentTabTag()); //save the tab selected
        super.onSaveInstanceState(outState);
    }
 
    /**
     * Step 2: Setup TabHost
     */
    private void initialiseTabHost(Bundle args) {
        mTabHost = (TabHost)findViewById(android.R.id.tabhost);
        mTabHost.setup();
        TabInfo tabInfo = null;
        Tab_MyLapak.addTab(this, this.mTabHost, this.mTabHost.newTabSpec("Tab1").setIndicator("Barang Dijual"), ( tabInfo = new TabInfo("Tab1", Tab_Dijual.class, args)));
        this.mapTabInfo.put(tabInfo.tag, tabInfo);
        Tab_MyLapak.addTab(this, this.mTabHost, this.mTabHost.newTabSpec("Tab2").setIndicator("Barang Tidak Dijual"), ( tabInfo = new TabInfo("Tab2", Tab_TidakDijual.class, args)));
        this.mapTabInfo.put(tabInfo.tag, tabInfo);
        
        // Default to first tab
        this.onTabChanged("Tab1");
        //
        mTabHost.setOnTabChangedListener(this);
    }
 
    /**
     * @param activity
     * @param tabHost
     * @param tabSpec
     * @param clss
     * @param args
     */
    private static void addTab(Tab_MyLapak activity, TabHost tabHost, TabHost.TabSpec tabSpec, TabInfo tabInfo) {
        // Attach a Tab view factory to the spec
        tabSpec.setContent(activity.new TabFactory(activity));
        String tag = tabSpec.getTag();
 
        // Check to see if we already have a fragment for this tab, probably
        // from a previously saved state.  If so, deactivate it, because our
        // initial state is that a tab isn't shown.
        tabInfo.fragment = activity.getSupportFragmentManager().findFragmentByTag(tag);
        if (tabInfo.fragment != null && !tabInfo.fragment.isDetached()) {
            FragmentTransaction ft = activity.getSupportFragmentManager().beginTransaction();
            ft.detach(tabInfo.fragment);
            ft.commit();
            activity.getSupportFragmentManager().executePendingTransactions();
        }
 
        tabHost.addTab(tabSpec);
    }
 
    /** (non-Javadoc)
     * @see android.widget.TabHost.OnTabChangeListener#onTabChanged(java.lang.String)
     */
    public void onTabChanged(String tag) {
        TabInfo newTab = (TabInfo) this.mapTabInfo.get(tag);
        //TabInfo newTab = this.mapTabInfo.get(tag);
    	if (mLastTab != newTab) {
            FragmentTransaction ft = this.getSupportFragmentManager().beginTransaction();
            if (mLastTab != null) {
                if (mLastTab.fragment != null) {
                    ft.detach(mLastTab.fragment);
                }
            }
            if (newTab != null) {
                if (newTab.fragment == null) {
                    newTab.fragment = Fragment.instantiate(this,
                            newTab.clss.getName(), newTab.args);
                    ft.add(R.id.realtabcontent, newTab.fragment, newTab.tag);
                } else {
                    ft.attach(newTab.fragment);
                }
            }
 
            mLastTab = newTab;
            ft.commit();
            this.getSupportFragmentManager().executePendingTransactions();
        }
    }
 
}<file_sep>package view.home;

import com.bukalapakmobile.R;

import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.widget.Button;

public class BaseHeader extends Activity{
	Button home;
	Button refresh;
	
	public void setHeader(){
		 home = (Button)findViewById(R.id.home_icon);
		 refresh = (Button)findViewById(R.id.refresh_icon);
		
	
	
	home.setOnClickListener(new View.OnClickListener() {
		public void onClick(View view) {
			startActivity(new Intent(BaseHeader.this,Dashboard.class));
			finish();
		}});
	
	refresh.setOnClickListener(new View.OnClickListener() {
		public void onClick(View view) {
		finish();
		startActivity(getIntent());
		}});

	}

}