fixed some NPE
This commit is contained in:
parent
645e57cd2c
commit
da54c028bd
|
@ -80,9 +80,8 @@ class UserTimelineFragment : ParcelableStatusesFragment() {
|
|||
return sb.toString()
|
||||
}
|
||||
|
||||
override fun onCreateStatusesLoader(context: Context,
|
||||
args: Bundle,
|
||||
fromUser: Boolean): Loader<List<ParcelableStatus>?> {
|
||||
override fun onCreateStatusesLoader(context: Context, args: Bundle, fromUser: Boolean):
|
||||
Loader<List<ParcelableStatus>?> {
|
||||
refreshing = true
|
||||
val data = adapterData
|
||||
val accountKey = Utils.getAccountKey(context, args)
|
||||
|
@ -98,9 +97,9 @@ class UserTimelineFragment : ParcelableStatusesFragment() {
|
|||
}
|
||||
|
||||
override fun onStatusesLoaded(loader: Loader<List<ParcelableStatus>?>, data: List<ParcelableStatus>?) {
|
||||
val timelineLoader = loader as UserTimelineLoader
|
||||
val timelineLoader = loader as? UserTimelineLoader
|
||||
if (!adapter.hasPinnedStatuses) {
|
||||
adapter.pinnedStatuses = timelineLoader.pinnedStatuses
|
||||
adapter.pinnedStatuses = timelineLoader?.pinnedStatuses
|
||||
}
|
||||
super.onStatusesLoaded(loader, data)
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ import android.text.SpannableString
|
|||
import android.text.style.URLSpan
|
||||
import android.view.ActionMode
|
||||
import android.view.Menu
|
||||
import android.view.MenuInflater
|
||||
import android.view.MenuItem
|
||||
import android.webkit.URLUtil
|
||||
import android.widget.TextView
|
||||
|
@ -37,7 +38,8 @@ import org.mariotaku.twidere.R
|
|||
class StatusActionModeCallback(private val textView: TextView, private val context: Context) : ActionMode.Callback {
|
||||
|
||||
override fun onCreateActionMode(mode: ActionMode, menu: Menu): Boolean {
|
||||
mode.menuInflater.inflate(R.menu.action_status_text_selection, menu)
|
||||
val inflater = mode.menuInflater ?: MenuInflater(context)
|
||||
inflater.inflate(R.menu.action_status_text_selection, menu)
|
||||
mode.setTitle(android.R.string.selectTextMode)
|
||||
return true
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue