I want to show the alert dialog inside a class which extends with arrayAdapter.
I am getting this error
android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
Here my code, what i have tried
public class DeteteAdapter extends ArrayAdapter<Gold> {
private int contexts = Intent.FLAG_ACTIVITY_NEW_TASK;
private Context context;
private List
public class MenuSettingFragment extends Fragment implements OnKeyListener,OnFocusChangeListener {
private String TAG = "MenuSettingFragment";
private TextView languageText,brightText;
private String[] brightArray;
private int brightIndex;
private Drawable bitmapBg,bitmapSelectBg;
private RelativeLayout languageLayout,brightLayout;
private View view;
private Content
I have an app, which shows toast below the actionbar. I'm using Crouton library for displaying toast. Here I'm placing custom layout for toast, that layout contains one textview and one button (for close option). So Toast appears with button. If I click that it should close the toast but nothing happens.. Below Code for this example.
i'm trying to make an Android app with an SQlite database, but when i try to make a query to the table "clientes" shows me a RuntimeException.
I have tried many things, I have found many solutions, but none works.
THe main class:
public class AndroidBaseDatos extends Activity {
private TextView texto;
private String nombre;
private DBHelper BD;
/**Array donde guardamos los nuevos dispositivos e
I have an android application which I want to send a simple command to my `public class ActivitymainActivity extends Activity {
private TextView textview;
private Button button;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activitymain);
textview=(TextView) findViewById(R.id.EmailCount);
button=(Button) f
In the past few days I started playing around with roboguice, robolectric and mockito. I have a small Android-application with a login-screen containing an AutoCompleteTextView for faster entering the username.
It was perfectly fine to update just a TextView, but when I tried to update a ListView from onReceive, I kept getting NullPointerException from getView method (BaseAdapter). I have tried
both
handler.post & runOnUiThread but the problem remains the same.
I'm building an audio recorder that needs to play back the recorded sound. I'm running into a lot of trouble playing back the audio.
This is my little test program. My problem is that from run() method I access to fields of wrong (old) Activity, which was destroyed after screen orientation changed.