当前位置: 首页>>代码示例>>Java>>正文


Java NavUtils.navigateUpFromSameTask方法代码示例

本文整理汇总了Java中android.support.v4.app.NavUtils.navigateUpFromSameTask方法的典型用法代码示例。如果您正苦于以下问题:Java NavUtils.navigateUpFromSameTask方法的具体用法?Java NavUtils.navigateUpFromSameTask怎么用?Java NavUtils.navigateUpFromSameTask使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v4.app.NavUtils的用法示例。


在下文中一共展示了NavUtils.navigateUpFromSameTask方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onOptionsItemSelected

import android.support.v4.app.NavUtils; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    try {
        switch (item.getItemId()) {
            case R.id.howToItem:
                Common.previousActivity = KeyboardDimensionActivity.class;
                Intent howToIntent = new Intent(this, WebViewActivity.class);
                howToIntent.putExtra("activity_title", getString(R.string.how_to_item));
                howToIntent.putExtra("web_url", getString(R.string.how_to_link));
                startActivity(howToIntent);
                break;
            case android.R.id.home:
                NavUtils.navigateUpFromSameTask(this);
                break;
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    return true;
}
 
开发者ID:MohammadAlBanna,项目名称:Swift-Braille-Soft-keyboard,代码行数:21,代码来源:KeyboardDimensionActivity.java

示例2: onOptionsItemSelected

import android.support.v4.app.NavUtils; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();

    //noinspection SimplifiableIfStatement
    if (id == R.id.action_settings) {
        return true;
    }
    //noinspection SimplifiableIfStatement
    if (id == android.R.id.home) {

        NavUtils.navigateUpFromSameTask(this);
    }

    return super.onOptionsItemSelected(item);
}
 
开发者ID:vikasdesale,项目名称:Wings2K16,代码行数:20,代码来源:Developer.java

示例3: onOptionsItemSelected

import android.support.v4.app.NavUtils; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    try {
        switch (item.getItemId()) {
            case R.id.howToItem:
                Common.previousActivity = DotsLayoutActivity.class;
                Intent howToIntent = new Intent(this, WebViewActivity.class);
                howToIntent.putExtra("activity_title", getString(R.string.how_to_item));
                howToIntent.putExtra("web_url", getString(R.string.how_to_link));
                startActivity(howToIntent);
                break;
            case android.R.id.home:
                NavUtils.navigateUpFromSameTask(this);
                break;
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    return true;
}
 
开发者ID:MohammadAlBanna,项目名称:Swift-Braille-Soft-keyboard,代码行数:21,代码来源:DotsStyleActivity.java

示例4: onOptionsItemSelected

import android.support.v4.app.NavUtils; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    try {
        switch (item.getItemId()) {
            case R.id.howToItem:
                Common.previousActivity = KeyboardLanguagesActivity.class;
                Intent howToIntent = new Intent(this, WebViewActivity.class);
                howToIntent.putExtra("activity_title", getString(R.string.how_to_item));
                howToIntent.putExtra("web_url", getString(R.string.how_to_link));
                startActivity(howToIntent);
                break;
            case android.R.id.home:
                NavUtils.navigateUpFromSameTask(this);
                break;
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    return true;
}
 
开发者ID:MohammadAlBanna,项目名称:Swift-Braille-Soft-keyboard,代码行数:21,代码来源:KeyboardLanguagesActivity.java

示例5: onOptionsItemSelected

import android.support.v4.app.NavUtils; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    try {
        switch (item.getItemId()) {
            case R.id.howToItem:
                Common.previousActivity = AdvancedActivity.class;
                Intent howToIntent = new Intent(this, WebViewActivity.class);
                howToIntent.putExtra("activity_title", getString(R.string.how_to_item));
                howToIntent.putExtra("web_url", getString(R.string.how_to_link));
                startActivity(howToIntent);
                break;
            case android.R.id.home:
                NavUtils.navigateUpFromSameTask(this);
                break;
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    return true;
}
 
开发者ID:MohammadAlBanna,项目名称:Swift-Braille-Soft-keyboard,代码行数:21,代码来源:AdvancedActivity.java

示例6: onOptionsItemSelected

import android.support.v4.app.NavUtils; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    if(item.getItemId() == android.R.id.home){
        NavUtils.navigateUpFromSameTask(this);
        return true;
    }
    return super.onOptionsItemSelected(item);
}
 
开发者ID:tpakis,项目名称:Charities,代码行数:9,代码来源:CharityDetails.java

示例7: onOptionsItemSelected

import android.support.v4.app.NavUtils; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();
    // When the home button is pressed, take the user back to the VisualizerActivity
    if (id == android.R.id.home) {
        NavUtils.navigateUpFromSameTask(this);
    }
    return super.onOptionsItemSelected(item);
}
 
开发者ID:soryncrash13,项目名称:Small-Android-apps,代码行数:10,代码来源:SettingsActivity.java

示例8: onMenuItemSelected

import android.support.v4.app.NavUtils; //导入方法依赖的package包/类
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    int id = item.getItemId();
    if (id == android.R.id.home) {
        if (!super.onMenuItemSelected(featureId, item)) {
            NavUtils.navigateUpFromSameTask(this);
        }
        return true;
    }
    return super.onMenuItemSelected(featureId, item);
}
 
开发者ID:an-garcia,项目名称:MovieGuide,代码行数:12,代码来源:SettingsActivity.java

示例9: onOptionsItemSelected

import android.support.v4.app.NavUtils; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();
    if (id == android.R.id.home) {
        // This ID represents the Home or Up button.
        NavUtils.navigateUpFromSameTask(this);
        return true;
    }
    return super.onOptionsItemSelected(item);
}
 
开发者ID:mo3rfan,项目名称:syncplayer,代码行数:11,代码来源:videoPlayer.java

示例10: onOptionsItemSelected

import android.support.v4.app.NavUtils; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch(item.getItemId()){
        case android.R.id.home:
            if(NavUtils.getParentActivityName(this)!=null){
                NavUtils.navigateUpFromSameTask(this);
            }
            return true;
        default:
            return super.onOptionsItemSelected(item);
    }
}
 
开发者ID:kotlin-korea,项目名称:Minimal-Todo,代码行数:13,代码来源:SettingsActivity.java

示例11: onOptionsItemSelected

import android.support.v4.app.NavUtils; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();
    if (id == android.R.id.home) {
        NavUtils.navigateUpFromSameTask(this.getActivity());
        return true;
    }
    return super.onOptionsItemSelected(item);
}
 
开发者ID:etsy,项目名称:divertsy-client,代码行数:10,代码来源:SettingsActivity.java

示例12: onMenuItemSelected

import android.support.v4.app.NavUtils; //导入方法依赖的package包/类
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
	int id = item.getItemId();
	if (id == android.R.id.home) {
		if (!super.onMenuItemSelected(featureId, item)) {
			NavUtils.navigateUpFromSameTask(this);
		}
		return true;
	}
	return super.onMenuItemSelected(featureId, item);
}
 
开发者ID:comp500,项目名称:SSLSocks,代码行数:12,代码来源:AdvancedSettingsActivity.java

示例13: onOptionsItemSelected

import android.support.v4.app.NavUtils; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(@NonNull final MenuItem item)
{
	switch (item.getItemId())
	{
		case android.R.id.home:
			NavUtils.navigateUpFromSameTask(this);
			return true;
	}
	return super.onOptionsItemSelected(item);
}
 
开发者ID:1313ou,项目名称:TreebolicPlugins,代码行数:12,代码来源:SettingsActivity.java

示例14: onOptionsItemSelected

import android.support.v4.app.NavUtils; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
        case android.R.id.home:
            NavUtils.navigateUpFromSameTask(this);
            return true;
        default:
            return super.onOptionsItemSelected(item);
    }
}
 
开发者ID:TryGhost,项目名称:Ghost-Android,代码行数:11,代码来源:BaseActivity.java

示例15: goBack

import android.support.v4.app.NavUtils; //导入方法依赖的package包/类
private void goBack(){

        if(wvMainWeb!=null && wvMainWeb.canGoBack()){
            wvMainWeb.goBack();
        }else{
            NavUtils.navigateUpFromSameTask(this);
        }

    }
 
开发者ID:covoiturage-libre,项目名称:covoiturage-libre-android,代码行数:10,代码来源:WebViewActivity.java


注:本文中的android.support.v4.app.NavUtils.navigateUpFromSameTask方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。