toast

第九次作业

一世执手 提交于 2019-12-05 03:24:23
package com.example.demo01; import java.util.Map; import android.app.Activity; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; import android.text.TextUtils; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; public class MainActivity extends ActionBarActivity { protected void

onPreferenceChange method isn't called when Listpreferences changes

孤街浪徒 提交于 2019-12-05 02:42:08
I have a Preferences Activity in my code. I want to show a toast when ever user change radio button in a ListPreferences. I used this code but it does not work. :( public class PrefsActivity extends PreferenceActivity implements OnSharedPreferenceChangeListener { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.prefs); } public void onSharedPreferenceChanged(SharedPreferences arg0, String key) { ListPreference listPreference = (ListPreference) findPreference(key); listPreference.setOnPreferenceChangeListener(new

作业9

廉价感情. 提交于 2019-12-04 20:25:51
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" android:padding="16dp" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="130dp" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="姓 名:" android:textSize="18sp" /

第九次作业

筅森魡賤 提交于 2019-12-04 20:03:33
package com.example.tongxunlu; import android.support.v7.app.ActionBarActivity; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; public class MainActivity extends ActionBarActivity { protected void onCreate(Bundle

Toast message not shown

大城市里の小女人 提交于 2019-12-04 15:02:40
I am trying to show a toast message in my application using the following code. AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.setTitle("Do you want to continue?"); alert.setPositiveButton("Continue", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { try{ //This code generates an Activity Not Found exception } catch(ActivityNotFoundException e) { System.out.println("Activity Not Found Exception Raised"); Toast.makeText(getBaseContext(), "Activity Not Found", Toast.LENGTH_LONG).show(); // For the context I tried using

Android: Have toast appear on button click

瘦欲@ 提交于 2019-12-04 13:22:35
问题 I'm fairly new to Android and just getting familiarized with the common stuff, but I can't get the hang of the onClickListner(); I basically have two checkboxes and a button and on button click a toast should show up and say which checkboxes are checked and which aren't. public class ExActivity extends Activity implements View.OnClickListener { CheckBox cb; CheckBox cb2; Button buton; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout

Custom Toast Cancel not working

半腔热情 提交于 2019-12-04 12:06:14
问题 I have seen a number of questions on cancelling toast. None of them is working. I have a custom Toast. The code for that is all but one line same as http://developer.android.com/guide/topics/ui/notifiers/toasts.html#CustomToastView The difference is as follows. The toast variable is defined as a class variable The entire java code is written in a method. In the start of this method, I have added the following line to cancel the toast. if (toast!=null){ toast.cancel(); } The method is called

Possible to use Toast Notifications from a regular .Net application?

可紊 提交于 2019-12-04 11:45:43
I've recently been checking out the samples for WinRT(C#) for Windows Store. One really cool thing I saw was the Toast Notifications. I can think of a million different uses for them, but not a single one that would also be suitable as a windows store application. So, is it possible to use Toast Notifications in Windows 8 from regular .Net desktop applications? Yes you can. Look here for more information. 来源: https://stackoverflow.com/questions/12431523/possible-to-use-toast-notifications-from-a-regular-net-application

第八次作业

假装没事ソ 提交于 2019-12-04 09:44:35
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginTop="50dp" android:src="@drawable/qq" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="30dp"> <TextView

salesforce lightning零基础学习(十四) Toast 浅入浅出

不打扰是莪最后的温柔 提交于 2019-12-04 09:43:19
本篇参考: https://developer.salesforce.com/docs/component-library/bundle/force:showToast/specification https://archive-2_9_4.lightningdesignsystem.com/components/toast/ Toast在项目中是基本不可能用不到的组件,用于在页面头部展示一条消息。之前也经常的用,但是没有深入的研究过,最近正好开始做lightning项目,便深入研究了一下,发现比以前了解的稍微多点,特此总结,便于以后的查看以及给没有接触过的小伙伴扫个盲。 一. Toast Toast 用于在页面的头部展示一条消息,比如我们在更新数据完成后会提示修改成功,出现异常会提示更新失败等。Lightning将Toast封装成了事件,我们只需要根据指定的步骤获取Toast事件并且进行fire触发即可。下方的demo中展示了toast的使用,使用 $A.get("e.force:showToast")便可以获取事件,添加相关的属性触发即可实现Toast功能。 showToast : function(component, event, helper) { var toastEvent = $A.get("e.force:showToast"); toastEvent