diff --git a/app/src/main/java/com/simplemobiletools/filemanager/fragments/ItemsFragment.java b/app/src/main/java/com/simplemobiletools/filemanager/fragments/ItemsFragment.java index 38af6b3e..4c7d5373 100644 --- a/app/src/main/java/com/simplemobiletools/filemanager/fragments/ItemsFragment.java +++ b/app/src/main/java/com/simplemobiletools/filemanager/fragments/ItemsFragment.java @@ -78,13 +78,12 @@ public class ItemsFragment extends android.support.v4.app.Fragment implements Ad } else { final String path = item.getPath(); final File file = new File(path); - MimeTypeMap myMime = MimeTypeMap.getSingleton(); - Intent newIntent = new Intent(Intent.ACTION_VIEW); - String mimeType = myMime.getMimeTypeFromExtension(Utils.getFileExtension(path)); - newIntent.setDataAndType(Uri.fromFile(file), mimeType); - newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + final String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(Utils.getFileExtension(path)); + final Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setDataAndType(Uri.fromFile(file), mimeType); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); try { - startActivity(newIntent); + startActivity(intent); } catch (ActivityNotFoundException e) { Utils.showToast(getContext(), R.string.no_app_found); } diff --git a/app/src/main/res/layout/items_fragment.xml b/app/src/main/res/layout/items_fragment.xml index 3dfd2f5b..dfd750ef 100644 --- a/app/src/main/res/layout/items_fragment.xml +++ b/app/src/main/res/layout/items_fragment.xml @@ -9,6 +9,7 @@ android:id="@+id/items_list" android:layout_width="match_parent" android:layout_height="wrap_content" + android:clipToPadding="false" android:paddingLeft="@dimen/activity_margin"/>