fixed crashes on link handler

This commit is contained in:
Mariotaku Lee 2015-10-10 10:21:51 +08:00
parent 7f48a7342c
commit 20584520dc
3 changed files with 12 additions and 6 deletions

View File

@ -115,6 +115,12 @@ public class TwitterLinkHandlerActivity extends Activity implements Constants {
finish();
}
@Override
protected void onStart() {
super.onStart();
setVisible(true);
}
@NonNull
private Pair<Intent, Boolean> getHandledIntent(final Uri uri) {
final List<String> pathSegments = uri.getPathSegments();
@ -213,7 +219,7 @@ public class TwitterLinkHandlerActivity extends Activity implements Constants {
return Pair.create(new Intent(Intent.ACTION_VIEW, builder.build()), true);
}
}
} else if (segsSize > 3) {
} else if (segsSize >= 3) {
if ("status".equals(pathSegments.get(1)) && ParseUtils.parseLong(pathSegments.get(2), -1) != -1) {
final Uri.Builder builder = new Uri.Builder();
builder.scheme(SCHEME_TWIDERE);

View File

@ -1200,12 +1200,12 @@ public class ComposeActivity extends ThemedFragmentActivity implements LocationL
*/
private boolean startLocationUpdateIfEnabled() {
final LocationManager lm = mLocationManager;
final boolean attachLocation = mPreferences.getBoolean(KEY_ATTACH_LOCATION);
if (!attachLocation) {
try {
lm.removeUpdates(this);
} catch (SecurityException ignore) {
}
final boolean attachLocation = mPreferences.getBoolean(KEY_ATTACH_LOCATION);
if (!attachLocation) {
return false;
}
final Criteria criteria = new Criteria();

View File

@ -3,7 +3,7 @@
<style name="Theme" />
<style name="Theme.Launcher" parent="android:Theme.NoDisplay">
<style name="Theme.Launcher" parent="Theme.Twidere.Dark.NoDisplay">
<item name="android:windowAnimationStyle">@android:style/Animation.Activity</item>
</style>