Skip to content

Commit b801310

Browse files
committed
Fix crashes
1 parent a7be471 commit b801310

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

Diff for: AndroidManifest.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
-->
2121
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2222
package="com.owncloud.android"
23-
android:versionCode="10040202"
24-
android:versionName="1.4.2 RC2">
23+
android:versionCode="10040203"
24+
android:versionName="1.4.2 RC3">
2525

2626
<uses-sdk
2727
android:minSdkVersion="14"

Diff for: src/com/owncloud/android/ui/activity/FileDisplayActivity.java

+8-6
Original file line numberDiff line numberDiff line change
@@ -466,12 +466,14 @@ private Fragment chooseInitialSecondFragment(OCFile file) {
466466
* @param fragment New second Fragment to set.
467467
*/
468468
private void setSecondFragment(Fragment fragment) {
469-
searchView.post(new Runnable() {
470-
@Override
471-
public void run() {
472-
searchView.setQuery("", true);
473-
}
474-
});
469+
if (searchView != null) {
470+
searchView.post(new Runnable() {
471+
@Override
472+
public void run() {
473+
searchView.setQuery("", true);
474+
}
475+
});
476+
}
475477
setDrawerIndicatorEnabled(false);
476478
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
477479
transaction.replace(R.id.right_fragment_container, fragment, TAG_SECOND_FRAGMENT);

Diff for: src/com/owncloud/android/ui/fragment/ExtendedListFragment.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
package com.owncloud.android.ui.fragment;
2222

2323
import android.animation.LayoutTransition;
24+
import android.app.Activity;
2425
import android.os.Bundle;
2526
import android.os.Handler;
2627
import android.support.annotation.DrawableRes;
@@ -268,8 +269,14 @@ public void run() {
268269
searchView.clearFocus();
269270
}
270271
} else {
271-
if (getActivity() != null) {
272-
((FileDisplayActivity) getActivity()).refreshListOfFilesFragment(true);
272+
Activity activity;
273+
if ((activity = getActivity()) != null) {
274+
if (activity instanceof FileDisplayActivity) {
275+
((FileDisplayActivity) activity).refreshListOfFilesFragment(true);
276+
} else {
277+
LocalFileListAdapter localFileListAdapter = (LocalFileListAdapter) mAdapter;
278+
localFileListAdapter.filter(query);
279+
}
273280

274281
}
275282
}

0 commit comments

Comments
 (0)