小编nan*_*dha的帖子

更新标题文本后,NavigationView标题中的值重复

在NavigationView标题中更新我的标题文本和图像后,我在NavigationView标题中获得重复值.

这是我的代码部分

public class MainActivity extends AppCompatActivity
    implements NavigationView.OnNavigationItemSelectedListener {

boolean doubleBackToExitPressedOnce = false;
SQLiteHelper dbHelper;
String setName, setMail;
AlertDialog.Builder builder, builder_verify;
public static int count = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    dbHelper = new SQLiteHelper(getApplicationContext());
    builder_verify = new AlertDialog.Builder(this);        

    DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
    ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
            this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
    drawer.setDrawerListener(toggle);
    toggle.syncState();     

    NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
    navigationView.setNavigationItemSelectedListener(this);
    View hView =  navigationView.inflateHeaderView(R.layout.nav_header_main);
    ImageView iv = …
Run Code Online (Sandbox Code Playgroud)

xml android android-navigationview

7
推荐指数
2
解决办法
1459
查看次数

标签 统计

android ×1

android-navigationview ×1

xml ×1