當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。