예제 #1
0
 @Override
 protected Integer handleResponse(Document doc) throws AwfulError {
   AwfulUtils.trimDbEntries(getContentResolver());
   AwfulThread.getThreadPosts(
       getContentResolver(),
       doc,
       threadId,
       page,
       getPreferences().postPerPage,
       getPreferences(),
       userId);
   return page;
 }
예제 #2
0
 @Override
 public void onActivityResult(int requestCode, int resultCode, Intent data) {
   if (resultCode == Activity.RESULT_OK) {
     if (requestCode == ADD_ATTACHMENT) {
       if (AwfulUtils.isMarshmallow()) {
         int permissionCheck =
             ContextCompat.checkSelfPermission(
                 getActivity(), Manifest.permission.READ_EXTERNAL_STORAGE);
         if (permissionCheck != PackageManager.PERMISSION_GRANTED) {
           this.attachmentData = data;
           requestPermissions(
               new String[] {Manifest.permission.READ_EXTERNAL_STORAGE},
               Constants.AWFUL_PERMISSION_READ_EXTERNAL_STORAGE);
         } else {
           addAttachment(data);
         }
       } else {
         addAttachment(data);
       }
     }
   }
 }