I want to display a loading process when my application is loading data from the database.
This is my Java file.
Where do I have to put the function to display the loading process?
public class AksesServerActivity extends ListActivity {
private static String link_url = "http://plnskh.zz.mu/android/berita/cekdaftar.php";    
private static final String AR_ID = "id";
private static final String AR_JUDUL = "judul";
private static final String AR_CONTENT = "content";
JSONArray artikel = null;
ArrayList<HashMap<String, String>> daftar_artikel = new ArrayList<HashMap<String, String>>();
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    JSONParser jParser = new JSONParser();
    JSONObject json = jParser.AmbilJson(link_url);
    try {
        artikel = json.getJSONArray("artikel");         
        for(int i = 0; i < artikel.length(); i++){
            JSONObject ar = artikel.getJSONObject(i);           
            String id = ar.getString(AR_ID);
            String judul = ar.getString(AR_JUDUL);
            String content = ar.getString(AR_CONTENT).substring(0,100)+"...(baca selengkapnya)";                
            HashMap<String, String> map = new HashMap<String, String>();
            map.put(AR_ID, id);
            map.put(AR_JUDUL, judul);
            map.put(AR_CONTENT, content);
            daftar_artikel.add(map);
        }
    } catch (JSONException e) {
        e.printStackTrace();
    }
    this.adapter_listview();
}
public void adapter_listview() {
    ListAdapter adapter = new SimpleAdapter(this, daftar_artikel,
            R.layout.list_item,
            new String[] { AR_JUDUL, AR_CONTENT, AR_ID}, new int[] {
                    R.id.judul, R.id.content, R.id.kode});
    setListAdapter(adapter);
    ListView lv = getListView();
    lv.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view,int position, long id) {
            String kode = ((TextView) view.findViewById(R.id.kode)).getText().toString();               
            Intent in = new Intent(AksesServerActivity.this, DetailAksesServer.class);
            in.putExtra(AR_ID, kode);
            startActivity(in);
        }
    });     
}
}
 
     
     
     
    