Skip to content Skip to sidebar Skip to footer
Showing posts with the label Android Context

Calling A Method In A Fragment From A Separate Class

What's the best way to call a method inside a fragment from a different class? I passed the con… Read more Calling A Method In A Fragment From A Separate Class

Passing Context As Argument Of Dialogfragment

it's possible to pass a context variable to a DialogFragment? i've use this code inside dia… Read more Passing Context As Argument Of Dialogfragment

Android: Passing Context To Helper Class Results In Npe

I am creating an Android app and I am trying to use a SettingsManager class to read and write prefe… Read more Android: Passing Context To Helper Class Results In Npe

Android Applicationtestcase Using A Mockcontext

I'm new to Android testing and I'm trying to create an ApplicationTestCase using a MockCont… Read more Android Applicationtestcase Using A Mockcontext

Null Context In Setuservisiblehint

A message needs to be displayed to the user when a fragment in a ViewPager becomes visible. Current… Read more Null Context In Setuservisiblehint

Null Pointer Exception When Checking For Permission With Android.content.context.checkpermission

I need to check for permissions before querying the Android calendar for events. To do it, Android … Read more Null Pointer Exception When Checking For Permission With Android.content.context.checkpermission

Bluetooth Device Discovery In Android -- Startdiscovery()

Goal: Build an Android app that discovers the names and addresses of BT devices within range and su… Read more Bluetooth Device Discovery In Android -- Startdiscovery()

Getting Main Activity From Main Application

I have the following manifest. Solution 1: There is no way to retrieve the application's main … Read more Getting Main Activity From Main Application

Unable To Set Proper Context To Cancel Alarmmanager

I have created an alarm with a notification and a button to stop the alarm but it seems that there … Read more Unable To Set Proper Context To Cancel Alarmmanager

Preventing Memory Leaks In Android

Is it wise to get a reference to a Context object in every Activity where I need a Context by getti… Read more Preventing Memory Leaks In Android

Sharedpreferences In Android Returns Null When Called From Another Activity

I made two activities, one for the widget and one for the settings activity. There are two variabl… Read more Sharedpreferences In Android Returns Null When Called From Another Activity

Null In While Using Context Menu For Recyclerview

I have read a lot of STACK questions and tried implementing everything possible. but i keep getting… Read more Null In While Using Context Menu For Recyclerview

Android Asynctask Context Terminated

When an Activity terminates, e.g. after screen orientation changing, is that possible to change an … Read more Android Asynctask Context Terminated

How To Initialize Context?

This is a really stupid question but what do I set context equal to in Context context = ... Just d… Read more How To Initialize Context?

Call Activity Method From Broadcast Receiver Android?

In my application I am sending a port SMS to the mobile. And when the message is recieved I need to… Read more Call Activity Method From Broadcast Receiver Android?

Change App Language In Android 5.0 Doesn't Work

I'm using this code below to change my app language on button click (changing from french to en… Read more Change App Language In Android 5.0 Doesn't Work