X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/3113c459092dbb3dea60e50efe61070e38804b09..233553a081997ec256715552aac691c6563cbe45:/src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java diff --git a/src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java b/src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java index a8f0d812..8dcdb9cc 100644 --- a/src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java +++ b/src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java @@ -292,8 +292,13 @@ public class FileDetailFragment extends SherlockFragment implements } Display display = getActivity().getWindowManager().getDefaultDisplay(); Point size = new Point(); - display.getSize(size); - int screenwidth = size.x; + int screenwidth; + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB_MR2) { + display.getSize(size); + screenwidth = size.x; + } else { + screenwidth = display.getWidth(); + } Log.e("ASD", "W " + width + " SW " + screenwidth); @@ -458,7 +463,9 @@ public class FileDetailFragment extends SherlockFragment implements private class DownloadFinishReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { - getView().findViewById(R.id.fdDownloadBtn).setEnabled(true); + if (getView()!=null && getView().findViewById(R.id.fdDownloadBtn) != null) + getView().findViewById(R.id.fdDownloadBtn).setEnabled(true); + if (intent.getAction().equals(FileDownloader.BAD_DOWNLOAD_MESSAGE)) { Toast.makeText(context, R.string.downloader_download_failed , Toast.LENGTH_SHORT).show();