Android Open Source - qshuttle_driver Activity Address






From Project

Back to project page qshuttle_driver.

License

The source code is released under:

MIT License

If you think the Android project qshuttle_driver listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.qshuttle.car;
/*from w w w .j  av a2 s  . co m*/
import java.util.ArrayList;

import com.qshuttle.car.PrefProxy.Address;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ImageButton;
import android.widget.ListView;
import android.widget.Toast;

public class ActivityAddress extends Activity {
  
  
  private ListView listView;
  
  private ListAdapterAddress listAdapter;
  
  
  private ArrayList<Address> listAddress;
  
  int resultCode ;
  
  Intent intentResult;
  
  
  

  /* (non-Javadoc)
   * @see android.app.Activity#onCreate(android.os.Bundle)
   */
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    
    Context context = getApplicationContext();
    
    listAddress = PrefProxy.getRecentAddressList(context);
    
    if(listAddress != null && listAddress.size() > 0){
    
      setContentView(R.layout.addresslist);
    
      listView = (ListView)findViewById(R.id.listView);
    
      listAdapter = new ListAdapterAddress(listAddress, context);
    
      listView.setAdapter(listAdapter);
    
      listView.setOnItemClickListener(listener);
    
      ((ImageButton)findViewById(R.id.imageButtonBack)).setOnClickListener(lsrButton);
    
    
      resultCode = Activity.RESULT_CANCELED;
    
      intentResult = new Intent();
        
    }
    else{
      
      Toast.makeText(context, R.string.address_list_null, Toast.LENGTH_LONG).show();
      
      finish();
      
    }

  }
  
  public OnClickListener lsrButton = new OnClickListener(){

    public void onClick(View v) {
      // TODO Auto-generated method stub
      
      finish();
      
    }
    
  };
  
  
  public  OnItemClickListener listener = new OnItemClickListener(){

    public void onItemClick(AdapterView<?> parent, View view, int position,
        long id) {
      // TODO Auto-generated method stub

      
      Address address = listAddress.get(position);
      
      int late6 = address.late6;
      int longe6 = address.longe6;
      
      intentResult.putExtra(ActivityMain.INTENT_EXTRA_KEY_LATE6, late6);
      intentResult.putExtra(ActivityMain.INTENT_EXTRA_KEY_LONGE6, longe6);
      
      resultCode = Activity.RESULT_OK;
      
      Log.i("address", address.address + ":"+address.late6 + "," +address.longe6);
      
      setResult(resultCode, intentResult);

      finish();

      
    }
    
    
    
    
    
  };

  /* (non-Javadoc)
   * @see android.app.Activity#onDestroy()
   */
  @Override
  protected void onDestroy() {
    // TODO Auto-generated method stub

    super.onDestroy();


  }
  
  

}




Java Source Code List

com.qshuttle.car.ActivityAddress.java
com.qshuttle.car.ActivityInfoRequest.java
com.qshuttle.car.ActivityMain.java
com.qshuttle.car.ActivityOfflineMap.java
com.qshuttle.car.DataOperator.java
com.qshuttle.car.DataProvider.java
com.qshuttle.car.DatabaseHelper.java
com.qshuttle.car.ExpandableListAdapter.java
com.qshuttle.car.GPSLocationOverlay.java
com.qshuttle.car.HostSettingActivity.java
com.qshuttle.car.ListAdapterAddress.java
com.qshuttle.car.ListAdapter.java
com.qshuttle.car.LongPressPopupOverlay.java
com.qshuttle.car.MapGestureDetectorOverlay.java
com.qshuttle.car.OverlayMapLocation.java
com.qshuttle.car.PassengerScheduleOverlay.java
com.qshuttle.car.PrefProxy.java
com.qshuttle.car.ThreadHttpPost.java
com.qshuttle.car.ThreadTimer.java
com.qshuttle.car.TimerCallBack.java
com.qshuttle.car.Timer.java
com.qshuttle.car.Utilities.java
com.qshuttle.car.WebApi.java