fix channel title for new tabs

This commit is contained in:
Christian Schabesberger 2017-10-26 20:45:16 +02:00
parent dd64bf2af7
commit 025a44b629
1 changed files with 15 additions and 0 deletions

View File

@ -26,6 +26,7 @@ import org.schabi.newpipe.R;
import org.schabi.newpipe.database.subscription.SubscriptionEntity;
import org.schabi.newpipe.extractor.ListExtractor;
import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.UrlIdHandler;
import org.schabi.newpipe.extractor.channel.ChannelInfo;
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
import org.schabi.newpipe.fragments.list.BaseListInfoFragment;
@ -82,6 +83,20 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
// LifeCycle
//////////////////////////////////////////////////////////////////////////*/
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if(activity != null
&& useAsFrontPage
&& isVisibleToUser) {
try {
activity.getSupportActionBar().setTitle(currentInfo.name);
} catch (Exception e) {
onError(e);
}
}
}
@Override
public void onAttach(Context context) {
super.onAttach(context);