- मुझे हमेशा अस्पष्टता है कि हमें एंड्रॉइड में inflater का उपयोग करने की आवश्यकता क्यों है, क्यों वे कस्टम लेआउट (जैसे नीचे) के लिए ListView में उपयोग किए जाते हैं?
- इन्फ्लेटर क्या है?
- इन्फ्लेटर का उपयोग करने का क्या फायदा है?
public class MobileArrayAdapter extends ArrayAdapter<String> {
private final Context context;
private final String[] values;
public MobileArrayAdapter(Context context, String[] values) {
super(context, R.layout.list_mobile, values);
this.context = context;
this.values = values;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View rowView = inflater.inflate(R.layout.list_mobile, parent, false);
TextView textView = (TextView) rowView.findViewById(R.id.label);
ImageView imageView = (ImageView) rowView.findViewById(R.id.logo);
textView.setText(values[position]);
धन्यवाद,सूचीदृश्य में इन्फ्लोटर का उपयोग क्यों करें
"कोई फायदा नहीं है। आपको कुछ तरीकों से अपने विचारों को बढ़ाने की आवश्यकता है" यह कथन स्पष्ट रूप से गलत है, आप हमेशा कोड –
में विचार बना सकते हैं मुझे स्पष्टीकरण देने दें .. संपादन देखें। – Joel
सवाल "इन्फ्लेटर का उपयोग करने का क्या फायदा है?" मेरे लिए अनुवाद करता है "कोड में विचार बनाने वाले इन्फ्लैटर बनाम का उपयोग करने का क्या फायदा है?"। आपका उत्तर "इसका उपयोग करने का कोई फायदा नहीं है [...]" गलत होगा अगर यह "विस्तारित" प्रश्न का उत्तर दे रहा है। –