Example usage for android.os RemoteException printStackTrace

List of usage examples for android.os RemoteException printStackTrace

Introduction

In this page you can find the example usage for android.os RemoteException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:pt.aptoide.backupapps.Aptoide.java

@Override
protected void onDestroy() {
    if (serviceDataIsBound) {
        pageIndicatorAdapter.destroy();/*from  w ww .j  av  a 2 s.  c  o  m*/
        try {
            serviceDataCaller.callUnregisterAvailableAppsObserver(serviceDataCallback);
        } catch (RemoteException e) {
            e.printStackTrace();
        }
        unbindService(serviceDataConnection);
        serviceDataIsBound = false;
    }
    //      categoriesAdapter.shutdownNow();
    availableAdapter.shutdownNow();
    installedAdapter.shutdownNow();
    //      updatableAdapter.shutdownNow();

    super.onDestroy();
}

From source file:com.owncloud.android.datamodel.FileDataStorageManager.java

public boolean removeFile(OCFile file, boolean removeDBData, boolean removeLocalCopy) {
    boolean success = true;
    if (file != null) {
        if (file.isFolder()) {
            success = removeFolder(file, removeDBData, removeLocalCopy);

        } else {/*from www  .  j a va 2  s .c o m*/
            if (removeDBData) {
                Uri file_uri = ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_FILE, file.getFileId());
                String where = ProviderTableMeta.FILE_ACCOUNT_OWNER + "=?" + " AND "
                        + ProviderTableMeta.FILE_PATH + "=?";
                String[] whereArgs = new String[] { mAccount.name, file.getRemotePath() };
                int deleted = 0;
                if (getContentProviderClient() != null) {
                    try {
                        deleted = getContentProviderClient().delete(file_uri, where, whereArgs);
                    } catch (RemoteException e) {
                        e.printStackTrace();
                    }
                } else {
                    deleted = getContentResolver().delete(file_uri, where, whereArgs);
                }
                success &= (deleted > 0);
            }
            String localPath = file.getStoragePath();
            if (removeLocalCopy && file.isDown() && localPath != null && success) {
                success = new File(localPath).delete();
                if (success) {
                    deleteFileInMediaScan(localPath);
                }
                if (!removeDBData && success) {
                    // maybe unnecessary, but should be checked TODO remove if unnecessary
                    file.setStoragePath(null);
                    saveFile(file);
                    saveConflict(file, null);
                }
            }
        }
    } else {
        success = false;
    }
    return success;
}

From source file:uk.co.senab.photoview.sample.ViewPagerActivity.java

public void contributeTenDollars() {
    new Thread(new Runnable() {
        public void run() {
            ArrayList skuList = new ArrayList();
            skuList.add(tenDollars);/*from   w w w. j  av  a2 s. c o m*/
            Bundle querySkus = new Bundle();
            querySkus.putStringArrayList("ITEM_ID_LIST", skuList);
            final Bundle skuDetails;
            try {

                skuDetails = mservice.getSkuDetails(3, getPackageName(), "inapp", querySkus);

                int response = skuDetails.getInt("RESPONSE_CODE");
                if (response == 0) {

                    ArrayList<String> responseList = skuDetails.getStringArrayList("DETAILS_LIST");

                    for (String thisResponse : responseList) {
                        JSONObject object = new JSONObject(thisResponse);
                        String sku = object.getString("productId");
                        String price = object.getString("price");
                        if (sku.equals(tenDollars)) {
                            System.out.println("price " + price);
                            Bundle buyIntentBundle = mservice.getBuyIntent(3, getPackageName(), sku, "inapp",
                                    "bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ");
                            PendingIntent pendingIntent = buyIntentBundle.getParcelable("BUY_INTENT");
                            startIntentSenderForResult(pendingIntent.getIntentSender(), 1001, new Intent(),
                                    Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0));
                        }
                    }
                }
                //
            } catch (RemoteException e) {

                e.printStackTrace();
            } catch (JSONException e) {

                e.printStackTrace();
            } catch (SendIntentException e) {

                e.printStackTrace();
            }
        }
    }).start();

}

From source file:uk.co.senab.photoview.sample.ViewPagerActivity.java

public void contributeHundredDollars() {
    new Thread(new Runnable() {
        public void run() {
            ArrayList skuList = new ArrayList();
            skuList.add(hundredDollars);
            Bundle querySkus = new Bundle();
            querySkus.putStringArrayList("ITEM_ID_LIST", skuList);
            final Bundle skuDetails;
            try {

                skuDetails = mservice.getSkuDetails(3, getPackageName(), "inapp", querySkus);

                int response = skuDetails.getInt("RESPONSE_CODE");
                if (response == 0) {

                    ArrayList<String> responseList = skuDetails.getStringArrayList("DETAILS_LIST");

                    for (String thisResponse : responseList) {
                        JSONObject object = new JSONObject(thisResponse);
                        String sku = object.getString("productId");
                        String price = object.getString("price");
                        if (sku.equals(hundredDollars)) {
                            System.out.println("price " + price);
                            Bundle buyIntentBundle = mservice.getBuyIntent(3, getPackageName(), sku, "inapp",
                                    "bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ");
                            PendingIntent pendingIntent = buyIntentBundle.getParcelable("BUY_INTENT");
                            startIntentSenderForResult(pendingIntent.getIntentSender(), 1001, new Intent(),
                                    Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0));
                        }/*from   ww w .  ja va  2  s  .  c om*/
                    }
                }
                //
            } catch (RemoteException e) {
                // 
                e.printStackTrace();
            } catch (JSONException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (SendIntentException e) {
                // 
                e.printStackTrace();
            }
        }
    }).start();

}

From source file:uk.co.senab.photoview.sample.ViewPagerActivity.java

public void contributeThreeDollars() {
    new Thread(new Runnable() {
        public void run() {
            ArrayList skuList = new ArrayList();
            skuList.add(threeDollars);// w  ww  .jav a  2  s.c  o  m
            Bundle querySkus = new Bundle();
            querySkus.putStringArrayList("ITEM_ID_LIST", skuList);
            final Bundle skuDetails;
            try {

                skuDetails = mservice.getSkuDetails(3, getPackageName(), "inapp", querySkus);

                int response = skuDetails.getInt("RESPONSE_CODE");
                if (response == 0) {

                    ArrayList<String> responseList = skuDetails.getStringArrayList("DETAILS_LIST");

                    for (String thisResponse : responseList) {
                        JSONObject object = new JSONObject(thisResponse);
                        String sku = object.getString("productId");
                        String price = object.getString("price");
                        if (sku.equals(threeDollars)) {
                            System.out.println("price " + price);
                            Bundle buyIntentBundle = mservice.getBuyIntent(3, getPackageName(), sku, "inapp",
                                    "bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ");
                            PendingIntent pendingIntent = buyIntentBundle.getParcelable("BUY_INTENT");
                            startIntentSenderForResult(pendingIntent.getIntentSender(), 1001, new Intent(),
                                    Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0));
                        }
                    }
                }
                //
            } catch (RemoteException e) {
                // 
                e.printStackTrace();
            } catch (JSONException e) {
                // 
                e.printStackTrace();
            } catch (SendIntentException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
    }).start();

}

From source file:uk.co.senab.photoview.sample.ViewPagerActivity.java

public void contributeFourDollars() {
    new Thread(new Runnable() {
        public void run() {
            ArrayList skuList = new ArrayList();
            skuList.add(fourDollars);//w  ww. j  av  a  2 s. c o m
            Bundle querySkus = new Bundle();
            querySkus.putStringArrayList("ITEM_ID_LIST", skuList);
            final Bundle skuDetails;
            try {

                skuDetails = mservice.getSkuDetails(3, getPackageName(), "inapp", querySkus);

                int response = skuDetails.getInt("RESPONSE_CODE");
                if (response == 0) {

                    ArrayList<String> responseList = skuDetails.getStringArrayList("DETAILS_LIST");

                    for (String thisResponse : responseList) {
                        JSONObject object = new JSONObject(thisResponse);
                        String sku = object.getString("productId");
                        String price = object.getString("price");
                        if (sku.equals(fourDollars)) {
                            System.out.println("price " + price);
                            Bundle buyIntentBundle = mservice.getBuyIntent(3, getPackageName(), sku, "inapp",
                                    "bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ");
                            PendingIntent pendingIntent = buyIntentBundle.getParcelable("BUY_INTENT");
                            startIntentSenderForResult(pendingIntent.getIntentSender(), 1001, new Intent(),
                                    Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0));
                        }
                    }
                }
                //
            } catch (RemoteException e) {
                // 
                e.printStackTrace();
            } catch (JSONException e) {
                // 
                e.printStackTrace();
            } catch (SendIntentException e) {
                // 
                e.printStackTrace();
            }
        }
    }).start();

}

From source file:pt.aptoide.backupapps.Aptoide.java

public void setAvailableListBy(boolean byCategory) {
    AptoideLog.d(Aptoide.this, "setAvailableList ByCategory? " + byCategory);
    try {//ww  w . j  a v  a 2 s  .com
        serviceDataCaller.callSetListsBy(byCategory);
    } catch (RemoteException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

From source file:pt.aptoide.backupapps.Aptoide.java

public void setAppsSortingPolicy(EnumAppsSorting sortingPolicy) {
    AptoideLog.d(Aptoide.this, "setAppsSortingPolicy to: " + sortingPolicy);
    try {// ww  w.jav  a  2  s.  c o  m
        serviceDataCaller.callSetAppsSortingPolicy(sortingPolicy.ordinal());
    } catch (RemoteException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

From source file:pt.aptoide.backupapps.Aptoide.java

public void setShowSystemApps(Boolean state) {
    AptoideLog.d(Aptoide.this, "setShowSystemAppsn to: " + state);
    try {/*w  w  w .ja  v  a2 s  .c  om*/
        serviceDataCaller.callSetShowSystemApps(state);
    } catch (RemoteException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

From source file:uk.co.senab.photoview.sample.ViewPagerActivity.java

public void contributeFiveDollars() {
    new Thread(new Runnable() {
        public void run() {
            ArrayList skuList = new ArrayList();
            skuList.add(fiveDollars);/* www  . ja v  a 2s. c o m*/
            Bundle querySkus = new Bundle();
            querySkus.putStringArrayList("ITEM_ID_LIST", skuList);
            final Bundle skuDetails;
            try {

                skuDetails = mservice.getSkuDetails(3, getPackageName(), "inapp", querySkus);

                int response = skuDetails.getInt("RESPONSE_CODE");
                if (response == 0) {

                    ArrayList<String> responseList = skuDetails.getStringArrayList("DETAILS_LIST");

                    for (String thisResponse : responseList) {
                        JSONObject object = new JSONObject(thisResponse);
                        String sku = object.getString("productId");
                        String price = object.getString("price");
                        if (sku.equals(fiveDollars)) {
                            System.out.println("price " + price);
                            Bundle buyIntentBundle = mservice.getBuyIntent(3, getPackageName(), sku, "inapp",
                                    "bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ");
                            PendingIntent pendingIntent = buyIntentBundle.getParcelable("BUY_INTENT");
                            startIntentSenderForResult(pendingIntent.getIntentSender(), 1001, new Intent(),
                                    Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0));
                        }
                    }
                }
                //
            } catch (RemoteException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (JSONException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (SendIntentException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
    }).start();

}