Skip to content Skip to sidebar Skip to footer

Android.content.context.getsystemservice(java.lang.string)' On A Null Object Reference

when click button on 'listview', I want to use Push Notification. But there is Error.. 'ListViewAdapter' public class ListViewAdapter extends BaseAdapter{ private Context con; pu

Solution 1:

Replace this line of code

LayoutInflaterinflater= 
    (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

with

LayoutInflaterinflater= 
    (LayoutInflater) con.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

Solution 2:

replace LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); with

LayoutInflater inflater = (LayoutInflater) con.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

Post a Comment for "Android.content.context.getsystemservice(java.lang.string)' On A Null Object Reference"