材料:
牛蕃茄4顆 / 薑末30g / 蛋6顆 / 蔥花2支 / 雞粉1茶匙 (柴魚粉+少許鹽巴)
作法:
起油鍋炒香薑末放入蕃茄拌炒
炒到番茄的外皮外翻後再加入調味過的蛋液
待4分熟的時候灑上蔥花後炒至七分熟就可以起鍋囉
private void setListViewParams(int margin) {
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
params.bottomMargin = margin;
params.topMargin = margin;
params.leftMargin = margin;
params.rightMargin = margin;
mParkingListView.setLayoutParams(params);
}
必須要延遲0.1秒 hidekeyboard才會有作用
mHandler.sendMessageDelayed(new Message() , 100);
private Handler mHandler = new Handler(){
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
Utils.hideKeyboard(mSearchView , getActivity());
}
};
public static void hideKeyboard(View focusView, Activity activity) {
// Check if no view has focus:
View view = focusView;
if (view != null) {
InputMethodManager inputManager = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
}
}
public class ProgressDialogFragment extends DialogFragment
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setCancelable(false);
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState)
{
ProgressDialog dialog = new ProgressDialog(getActivity(), getTheme());
dialog.show();
dialog.setContentView(R.layout.progress_dialog);
return dialog;
}
}
private static Boolean isQuit = false;
Timer timer = new Timer();
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
if (isQuit == false) {
isQuit = true;
Toast.makeText(getBaseCoNtext(), "再按一次返回鍵退出程式", Toast.LENGTH_SHORT).show();
TimerTask task = null;
task = new TimerTask() {
@Override
public void run() {
isQuit = false;
}
};
timer.schedule(task, 2000);
} else {
finish();
System.exit(0);
}
}
return false;
}
FileContext context = new FileContext(); context.setFileState(new OpenState()); System.out.println(ctx1.state());
TextView textview = (TextView) findViewById(R.id.textview1); Paint paint = textview.getPaint(); paint.setFlags(Paint.STRIKE_THRU_TEXT_FLAG); paint.setAntiAlias(true);
//Strategy->Interface , DiscountStrategy implements Strategy Strategy strategy = new DiscountStrategy(); Price price = new Price(strategy); double price = price.calculate(200); ->會使用DiscountStrategy的策略方法打折