So, I'm just trying to inflate the view in my getView function, and getContext () for some reason says it's undefined ..
package com.MTSUAndroid; import com.MTSUAndroid.Alarm_Settings.EfficientAdapter1.ViewHolder; import android.app.Activity; import android.app.AlertDialog; import android.app.ListActivity; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.BaseAdapter; import android.widget.ListView; import android.widget.TextView; import android.widget.ImageView; import android.graphics.BitmapFactory; import android.graphics.Bitmap; public class Alarm_Settings extends ListActivity { public static class EfficientAdapter1 extends BaseAdapter{ private LayoutInflater mInflater; public EfficientAdapter1(Context context){ mInflater = LayoutInflater.from(context); } @Override public int getCount() {
This is part of the code I'm having problems with. LayoutInflater vi = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); getContext () is not defined for the class, and I do not understand why: (
source share