Example usage for android.widget Toast LENGTH_LONG

List of usage examples for android.widget Toast LENGTH_LONG

Introduction

In this page you can find the example usage for android.widget Toast LENGTH_LONG.

Prototype

int LENGTH_LONG

To view the source code for android.widget Toast LENGTH_LONG.

Click Source Link

Document

Show the view or text notification for a long period of time.

Usage

From source file:com.citrus.sdk.fragments.Netbanking.java

private void initListener() {
    onNetbankfetched = new JSONTaskComplete() {
        @Override//from w  ww  .  ja va2s  . c  o m
        public void onTaskExecuted(JSONObject[] options, String message) {

            try {
                if (!TextUtils.equals(message, "success")) {
                    Toast.makeText(getActivity().getApplicationContext(),
                            "Check your net connection or vanity url", Toast.LENGTH_LONG).show();
                } else {
                    JSONArray array = options[0].getJSONArray("netBanking");
                    myOptions.storeBanks(array);
                    initBanks();
                }

            } catch (JSONException e) {
                return;
            }

        }
    };
}

From source file:com.commonsware.android.strict.WeatherDemo.java

private void updateForecast(Location loc) {
    String url = String.format(format, loc.getLatitude(), loc.getLongitude());
    HttpGet getMethod = new HttpGet(url);

    try {//  w  w  w .j av a 2  s  . c o  m
        ResponseHandler<String> responseHandler = new BasicResponseHandler();
        String responseBody = client.execute(getMethod, responseHandler);
        buildForecasts(responseBody);

        String page = generatePage();

        browser.loadDataWithBaseURL(null, page, "text/html", "UTF-8", null);
    } catch (Throwable t) {
        android.util.Log.e("WeatherDemo", "Exception fetching data", t);
        Toast.makeText(this, "Request failed: " + t.toString(), Toast.LENGTH_LONG).show();
    }
}

From source file:com.chexiaoya.gaodemapdemo.SpeechSearchActivity.java

private void showToast(int message) {
    Toast.makeText(this, message + "", Toast.LENGTH_LONG).show();
}

From source file:is.heklapunch.sendjson.SendJSON.java

protected void report(int code) {
    if (code == -1) {
        Toast.makeText(this._caller, "Error: " + this._last_error, Toast.LENGTH_LONG).show();
    } else {//from   w w w  .  ja  v a 2 s  .co  m
        Toast.makeText(this._caller, "HTTP STATUS CODE: " + code, Toast.LENGTH_LONG).show();
    }
    this._caller.finish();
}

From source file:com.bt.download.android.gui.util.UIUtils.java

public static void showLongMessage(Context context, String message) {
    showToastMessage(context, message, Toast.LENGTH_LONG);
}

From source file:com.oakesville.mythling.MediaListActivity.java

@Override
protected void onResume() {
    try {/*from www  .j a v  a  2s .c o  m*/
        if (getAppData() == null || getAppData().isExpired())
            refresh();
        else
            populate();
    } catch (Exception ex) {
        Log.e(TAG, ex.getMessage(), ex);
        if (getAppSettings().isErrorReportingEnabled())
            new Reporter(ex).send();
        Toast.makeText(getApplicationContext(), getString(R.string.error_) + ex.toString(), Toast.LENGTH_LONG)
                .show();
    }

    super.onResume();
}

From source file:com.iternox.piggate.samples.PiggateLogin.Activity_Main.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    _piggate = new Piggate(this, null);
    Boolean logout = false;/* ww w. ja v  a2s  . c o  m*/
    if (getIntent().getExtras() != null)
        logout = getIntent().getExtras().getBoolean("ACTIVITY_MAIN_CREATED_BY_BUTTON_LOGOUT", false);

    setContentView(R.layout.activity_main);

    final Button login = (Button) findViewById(R.id.buttonloginmain);
    final Button register = (Button) findViewById(R.id.buttonregistermain);

    login.setOnClickListener(new View.OnClickListener() {
        @Override
        synchronized public void onClick(View v) {
            if (!handledClick) {
                handledClick = true;

                Intent slideactivity = new Intent(Activity_Main.this, Activity_SingIn.class);
                Bundle bndlanimation = ActivityOptions
                        .makeCustomAnimation(getApplicationContext(), R.anim.flip1, R.anim.flip2).toBundle();
                startActivity(slideactivity, bndlanimation);
            }

        }
    });
    register.setOnClickListener(new View.OnClickListener() {
        @Override
        synchronized public void onClick(View v) {
            if (!handledClick) {
                handledClick = true;

                Intent slideactivity = new Intent(Activity_Main.this, Activity_SingUp.class);
                Bundle bndlanimation = ActivityOptions
                        .makeCustomAnimation(getApplicationContext(), R.anim.flip1, R.anim.flip2).toBundle();
                startActivity(slideactivity, bndlanimation);

            }

        }
    });
    if (!logout && checkInternetConnection()) //If you close the application without logout, the session will be active
        _piggate.RequestUser().setListenerRequest(new Piggate.PiggateCallBack() {
            @Override
            public void onComplete(int statusCode, Header[] headers, String msg, JSONObject data) {
                Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_LONG).show();
                Intent slideactivity = new Intent(Activity_Main.this, Activity_Logged.class);
                Bundle bndlanimation = ActivityOptions
                        .makeCustomAnimation(getApplicationContext(), R.anim.flip1, R.anim.flip2).toBundle();
                startActivity(slideactivity, bndlanimation);
            }

            @Override
            public void onError(int statusCode, Header[] headers, String msg, JSONObject data) {
                _piggate.reload();
            }

            @Override
            public void onComplete(int statusCode, Header[] headers, String msg, JSONArray data) {
                //Unused
            }

            @Override
            public void onError(int statusCode, Header[] headers, String msg, JSONArray data) {
                //Unused
            }
        }).exec();

}

From source file:com.ccxt.whl.activity.RegisterActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_register);

    DeviceUuidFactory uuid = new DeviceUuidFactory(this);
    uid = uuid.getDeviceUuid().toString();

    emailEditText = (EditText) findViewById(R.id.email);
    emailEditText.setInputType(InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);//??
    userNameEditText = (EditText) findViewById(R.id.username);
    passwordEditText = (EditText) findViewById(R.id.password);
    confirmPwdEditText = (EditText) findViewById(R.id.confirm_password);

    rg = (RadioGroup) findViewById(R.id.sex);
    b1 = (RadioButton) findViewById(R.id.male);
    b2 = (RadioButton) findViewById(R.id.female);

    rg.setOnCheckedChangeListener(new OnCheckedChangeListener() {

        @Override/*w ww.  ja  v  a 2 s  .co m*/
        public void onCheckedChanged(RadioGroup group, int checkedId) {
            // TODO Auto-generated method stub
            if (checkedId == b1.getId()) {
                sex = "1";
                Toast.makeText(RegisterActivity.this, "", Toast.LENGTH_LONG).show();
            }
            if (checkedId == b2.getId()) {
                sex = "2";
                Toast.makeText(RegisterActivity.this, "", Toast.LENGTH_LONG).show();
            }

        }

    });
}

From source file:com.google.zxing.client.android.history.HistoryActivity.java

@Override
protected void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    pegaScreenResolution();/*from w w w.  j ava  2  s . com*/
    this.historyManager = new HistoryManager(this);
    adapter = new HistoryItemAdapter(this);

    setListAdapter(adapter);
    View listview = getListView();
    registerForContextMenu(listview);
    originalTitle = getTitle();

    Intent intent = getIntent();
    Bundle bundle = intent.getExtras();
    String txt = bundle.getString("envia_dados");
    if (txt.equals("envia_dados")) {
        Toast.makeText(this, R.string.toast_envia_dado_acima, Toast.LENGTH_LONG).show();
    }
}

From source file:com.dragon4.owo.ar_trace.ARCore.MixState.java

public void DialogSelectOption(final MixContext ctx, final String markerTitle, final PhysicalPlace log,
        final String onPress) {
    final String items[] = { "?  ", "?" };
    AlertDialog.Builder ab = new AlertDialog.Builder(ctx);
    ab.setTitle(markerTitle);//from www  .  j  a  v  a2  s.  c  o  m
    ab.setItems(items, new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int id) {
            // ? 
            Toast.makeText(ctx, items[id] + " ?.", Toast.LENGTH_SHORT).show();
            dialog.dismiss();

            if (id == 0) {
                try {
                    ctx.loadMixViewWebPage(onPress);
                } catch (Exception e) {
                }
            } else if (id == 1) {
                Navigator navigator = Navigator.getNavigator();
                if (navigator != null)
                    navigator.run(log.getLatitude(), log.getLongitude());
                else
                    Toast.makeText(ctx, "? ?   .",
                            Toast.LENGTH_LONG).show();
            }

        }
    });
    // ? ?
    AlertDialog alertDialog = ab.create();
    // ? 
    alertDialog.show();
}