void showToast(String text,boolean longDuration){
  if (mLastToast != null)   mLastToast.cancel();
  mLastToast=Toast.makeText(TermuxActivity.this,text,longDuration ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT);
  mLastToast.setGravity(Gravity.TOP,0,0);
  mLastToast.show();
}

void showToast ( String text , boolean longDuration ) { if ( mLastToast != null ) mLastToast . cancel ( ) ; mLastToast = Toast . makeText ( TermuxActivity . this , text , longDuration ? Toast . LENGTH_LONG : Toast . LENGTH_SHORT ) ; mLastToast . setGravity ( Gravity . TOP , 0 , 0 ) ; mLastToast . show ( ) ; }
show a toast and dismiss the last one if still visible .
