bug fixes
This commit is contained in:
parent
513508c4eb
commit
2b9fe5c0d4
|
@ -175,6 +175,7 @@ public abstract class ParcelableStatusesAdapter extends LoadMoreSupportAdapter<R
|
|||
if (dataPosition < 0 || dataPosition >= getRawStatusCount()) return -1;
|
||||
if (mData instanceof ObjectCursor) {
|
||||
final Cursor cursor = ((ObjectCursor) mData).getCursor();
|
||||
// TODO safe move to position using Kotlin extension
|
||||
if (!cursor.moveToPosition(dataPosition)) return -1;
|
||||
final ParcelableStatusCursorIndices indices = (ParcelableStatusCursorIndices) ((ObjectCursor) mData).getIndices();
|
||||
return cursor.getLong(indices.timestamp);
|
||||
|
@ -188,6 +189,7 @@ public abstract class ParcelableStatusesAdapter extends LoadMoreSupportAdapter<R
|
|||
if (dataPosition < 0 || dataPosition >= getRawStatusCount()) return -1;
|
||||
if (mData instanceof ObjectCursor) {
|
||||
final Cursor cursor = ((ObjectCursor) mData).getCursor();
|
||||
// TODO safe move to position using Kotlin extension
|
||||
if (!cursor.moveToPosition(dataPosition)) return -1;
|
||||
final ParcelableStatusCursorIndices indices = (ParcelableStatusCursorIndices) ((ObjectCursor) mData).getIndices();
|
||||
final long positionKey = cursor.getLong(indices.position_key);
|
||||
|
@ -206,6 +208,7 @@ public abstract class ParcelableStatusesAdapter extends LoadMoreSupportAdapter<R
|
|||
if (dataPosition < 0 || dataPosition >= getRawStatusCount()) return null;
|
||||
if (mData instanceof ObjectCursor) {
|
||||
final Cursor cursor = ((ObjectCursor) mData).getCursor();
|
||||
// TODO safe move to position using Kotlin extension
|
||||
if (!cursor.moveToPosition(dataPosition)) return null;
|
||||
final ParcelableStatusCursorIndices indices = (ParcelableStatusCursorIndices) ((ObjectCursor) mData).getIndices();
|
||||
return UserKey.valueOf(cursor.getString(indices.account_key));
|
||||
|
|
|
@ -23,6 +23,7 @@ import android.content.ActivityNotFoundException;
|
|||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.BadParcelableException;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
|
||||
|
@ -195,10 +196,12 @@ public class OnLinkClickHandler implements OnLinkClickListener {
|
|||
intent.setClass(context, WebLinkHandlerActivity.class);
|
||||
intent.putExtra(EXTRA_ACCOUNT_KEY, accountKey);
|
||||
intent.setExtrasClassLoader(TwidereApplication.class.getClassLoader());
|
||||
try {
|
||||
context.startActivity(intent);
|
||||
} catch (final ActivityNotFoundException e) {
|
||||
// TODO
|
||||
if (intent.resolveActivity(context.getPackageManager()) != null) {
|
||||
try {
|
||||
context.startActivity(intent);
|
||||
} catch (final BadParcelableException e) {
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue