小编use*_*066的帖子

如何更改活动的层次结构父级?

目前它是主要活动,但我想将其更改为Categories活动.这是问题所在吗?

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case android.R.id.home:
        // This ID represents the Home or Up button. In the case of this
        // activity, the Up button is shown. Use NavUtils to allow users
        // to navigate up one level in the application structure. For
        // more details, see the Navigation pattern on Android Design:
        //
        // http://developer.android.com/design/patterns/navigation.html#up-vs-back
        //
        NavUtils.navigateUpFromSameTask(this);
        return true;
    }
    return super.onOptionsItemSelected(item);
Run Code Online (Sandbox Code Playgroud)

java android class-hierarchy

7
推荐指数
1
解决办法
8270
查看次数

标签 统计

android ×1

class-hierarchy ×1

java ×1