Fixed an issue with back key behavior

Create mHeaderView and set it as a pinned header, each time onActivityCreated
is called.

Bug: 20652673
Change-Id: Ia0e174f0686ac0abb601c591f3774c9152b785fa
This commit is contained in:
Fyodor Kupolov
2015-04-29 17:36:36 -07:00
parent c531044671
commit 5654815695
2 changed files with 8 additions and 14 deletions

View File

@@ -23,6 +23,7 @@ import android.content.pm.UserInfo;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
@@ -57,15 +58,13 @@ public class RestrictedProfileSettings extends AppRestrictionsFragment
@Override
public void onActivityCreated(Bundle savedInstanceState) {
if (mHeaderView == null) {
mHeaderView = setPinnedHeaderView(R.layout.user_info_header);
mHeaderView.setOnClickListener(this);
mUserIconView = (ImageView) mHeaderView.findViewById(android.R.id.icon);
mUserNameView = (TextView) mHeaderView.findViewById(android.R.id.title);
mDeleteButton = (ImageView) mHeaderView.findViewById(R.id.delete);
mDeleteButton.setOnClickListener(this);
getListView().setFastScrollEnabled(true);
}
mHeaderView = setPinnedHeaderView(R.layout.user_info_header);
mHeaderView.setOnClickListener(this);
mUserIconView = (ImageView) mHeaderView.findViewById(android.R.id.icon);
mUserNameView = (TextView) mHeaderView.findViewById(android.R.id.title);
mDeleteButton = (ImageView) mHeaderView.findViewById(R.id.delete);
mDeleteButton.setOnClickListener(this);
getListView().setFastScrollEnabled(true);
// This is going to bind the preferences.
super.onActivityCreated(savedInstanceState);
}