Search in sources :

Example 1 with GeoBean

use of org.qii.weiciyuan.bean.GeoBean in project weiciyuan by qii.

the class SendWeiboService method onStartCommand.

@Override
public int onStartCommand(Intent intent, int flags, int startId) {
    int lastNotificationId = intent.getIntExtra("lastNotificationId", -1);
    String token = intent.getStringExtra("token");
    AccountBean account = (AccountBean) intent.getParcelableExtra("account");
    String picPath = intent.getStringExtra("picPath");
    String content = intent.getStringExtra("content");
    GeoBean geoBean = (GeoBean) intent.getParcelableExtra("geo");
    StatusDraftBean statusDraftBean = (StatusDraftBean) intent.getParcelableExtra("draft");
    WeiboSendTask task = new WeiboSendTask(lastNotificationId, token, account, picPath, content, geoBean, statusDraftBean);
    task.executeOnExecutor(MyAsyncTask.THREAD_POOL_EXECUTOR);
    tasksResult.put(task, false);
    return START_REDELIVER_INTENT;
}
Also used : StatusDraftBean(org.qii.weiciyuan.support.database.draftbean.StatusDraftBean) AccountBean(org.qii.weiciyuan.bean.AccountBean) GeoBean(org.qii.weiciyuan.bean.GeoBean)

Example 2 with GeoBean

use of org.qii.weiciyuan.bean.GeoBean in project weiciyuan by qii.

the class WriteWeiboActivity method updateWithNewLocation.

private void updateWithNewLocation(Location result) {
    haveGPS.setVisibility(View.VISIBLE);
    geoBean = new GeoBean();
    geoBean.setLatitude(result.getLatitude());
    geoBean.setLongitude(result.getLongitude());
    if (Utility.isTaskStopped(locationTask)) {
        locationTask = new GetGoogleLocationInfo(geoBean);
        locationTask.executeOnExecutor(MyAsyncTask.THREAD_POOL_EXECUTOR);
    }
    ((LocationManager) WriteWeiboActivity.this.getSystemService(Context.LOCATION_SERVICE)).removeUpdates(locationListener);
}
Also used : LocationManager(android.location.LocationManager) GeoBean(org.qii.weiciyuan.bean.GeoBean)

Aggregations

GeoBean (org.qii.weiciyuan.bean.GeoBean)2 LocationManager (android.location.LocationManager)1 AccountBean (org.qii.weiciyuan.bean.AccountBean)1 StatusDraftBean (org.qii.weiciyuan.support.database.draftbean.StatusDraftBean)1