本文整理匯總了Java中android.app.AlertDialog.Builder.show方法的典型用法代碼示例。如果您正苦於以下問題:Java Builder.show方法的具體用法?Java Builder.show怎麽用?Java Builder.show使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.app.AlertDialog.Builder
的用法示例。
在下文中一共展示了Builder.show方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: show
import android.app.AlertDialog.Builder; //導入方法依賴的package包/類
public void show(String searchName,ArrayList<String> filePathList){
// タイトル
String strTitle = searchName+"駅を検索";
// リストビュー
ListView listview = new ListView( m_parent );
listview.setScrollingCacheEnabled( false );
listview.setOnItemClickListener( this );
// ファイルリスト
List<FileInfo> listFileInfo = new ArrayList<>();
for( String filePath : filePathList ){
File file=new File(filePath);
if(!file.exists()){
continue;
}
System.out.println(filePath);
if(file.getName().endsWith(".oud")||file.getName().endsWith(".oud2")) {
String[] stationName=loadStartEndStation(file);
listFileInfo.add(new FileInfo(stationName[0]+"~"+stationName[1]+"\n"+file.getName(),file));
}
}
Collections.sort( listFileInfo );
m_fileinfoarrayadapter = new FileInfoArrayAdapter( m_parent, listFileInfo );
listview.setAdapter( m_fileinfoarrayadapter );
Builder builder = new AlertDialog.Builder( m_parent );
builder.setTitle( strTitle );
builder.setNeutralButton("キャンセル", null );
builder.setView( listview );
m_dlg = builder.show();
}
示例2: changeTextDirection
import android.app.AlertDialog.Builder; //導入方法依賴的package包/類
@SuppressLint("NewApi")
private void changeTextDirection(Builder dlg){
int currentapiVersion = android.os.Build.VERSION.SDK_INT;
dlg.create();
AlertDialog dialog = dlg.show();
if (currentapiVersion >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
TextView messageview = (TextView)dialog.findViewById(android.R.id.message);
messageview.setTextDirection(android.view.View.TEXT_DIRECTION_LOCALE);
}
}
示例3: noNetworkDialog
import android.app.AlertDialog.Builder; //導入方法依賴的package包/類
private void noNetworkDialog(){
Builder dialogNoNetwork;
dialogNoNetwork = new AlertDialog.Builder(this);
dialogNoNetwork.setCancelable(true);
dialogNoNetwork.setOnCancelListener(new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
finish();
}
});
dialogNoNetwork.setTitle(R.string.nonetwork_title);
dialogNoNetwork.setMessage(getString(R.string.nonetwork_message));
dialogNoNetwork.show();
}
示例4: showDialog
import android.app.AlertDialog.Builder; //導入方法依賴的package包/類
public static void showDialog(Activity context, String strTitle, String strText, int icon) {
if (context != null && !context.isFinishing() && !context.isRestricted()) {
Builder tDialog = new Builder(context);
tDialog.setIcon(icon);
tDialog.setTitle(strTitle);
tDialog.setMessage(strText);
tDialog.setPositiveButton(R.string.Ensure, null);
try {
tDialog.show();
} catch (Exception e) {
}
}
}
示例5: showError
import android.app.AlertDialog.Builder; //導入方法依賴的package包/類
/**
* Show a visual error message to the user.
*
* @param message
* the message to show
*/
private void showError(String message) {
final Builder builder = new AlertDialog.Builder(AlbumListActivity.this);
builder.setTitle(message);
builder.setIcon(android.R.drawable.ic_dialog_alert);
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
builder.setMessage(message);
builder.show();
}