Kişisel Sayfaları
İlgi Alanları
İş Tecrubesi
Eğitim Geçmişi
Sertifikalar & Başarılar
Kullanıcıya ait test sonucu bulunmamaktadır.
Dil Becerileri
Son Forum Aktiviteleri
5Listview baseadapter
Merhaba arkadaşlar Listview içerisinde base adapter kullanıyorum.Fakat base adapter içerisinde 30 a yakın veri var ve 1snde yenileme işlemi yapıyorum notifydatachange () metodunu kullanarak.Ilk açılışta listview içerisine adapte ederken telefonda aşırı bir kasma oluyor.1 saniyede kontrol etme işlemini timer ile yaptim.Adapter.setadapter'i kullandım.Bu kasma sorununu nasil çözebilirim ?
Hashcode null object
Merhaba arkadaşlar
Veritabanına veri ekleyip baseadapter kullanarak bir listviewde listeliyorum fakat bikaç tane ekledikten sonra hashcode null object reference hatası alıyorum .
public class OzelAdaptor extends BaseAdapter {
Context c;
degiskenler d1=new degiskenler();
LayoutInflater layoutInflater;
List<kitapsinifi> list;
public OzelAdaptor(Activity activity, List<kitapsinifi> mList) {
layoutInflater=(LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
list=mList;
}
public OzelAdaptor(Context applicationContext, List<kitapsinifi> listkitaplar) {
list=listkitaplar;
layoutInflater=(LayoutInflater)applicationContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
@Override
public int getCount() {
return list.size();
}
@Override
public Object getItem(int position) {
return position;
}
@Override
public long getItemId(int position) {
return (long)getItem(position).hashCode();
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view=layoutInflater.inflate(R.layout.ornektasarim,null);
final ImageView iv=(ImageView)view.findViewById(R.id.imageViewdizi);
final TextView text1=(TextView)view.findViewById(R.id.textViewad);
final TextView text2=(TextView)view.findViewById(R.id.tv_yazar);
final TextView text3=(TextView)view.findViewById(R.id.tv_yayinevi);
kitapsinifi kitap =list.get(position);
String ad=kitap.getKitapad();
String yazar=kitap.getKitapyazar();
String yayinevi=kitap.getKitapyayinevi();
switch (ad)
{
case "Elektronik":
Picasso.with(view.getContext()).load(d1.url_elektronikhobi).into(iv);
yazar=("Güclü Tuğay");
yayinevi=("ALFA YAYINLARI");
break;
default:break;
}
text1.setText(ad);
text2.setText(yazar);
text3.setText(yayinevi);
return view;
}
}
Urlden çekme
Merhaba arkadaşlar
Url'den resim çekip R.drawable.. içerisine atmak istiyorum.Daha sonra kullanırken R.drawable içerisinden çağırmam gerekiyor.Yardımcı olabilir misiniz ?
Fragment içerisinde intent çağırma
Merhaba arkadaşlar
Fragment içerisindeki resime tıklandığında yeni intent açmasını istiyorum . Yeni intenti açıyor fakat içerisinde veri olmasına rağmen boş bir intent açılıyor.
public class sınıf extends Fragment {
Activity context;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable final ViewGroup container, @Nullable Bundle savedInstanceState)
{
View view = inflater.inflate(R.layout.sınıf, container, false);
context=getActivity();
final ImageView image1=(ImageView)view.findViewById(R.id.imageView);
String url_image1="http:/......jpg"; Picasso.with(getActivity().getApplicationContext()).load(url_image1).into(image1);
image1.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
Intent a=new Intent(getActivity(),b.class);
startActivity(a);
} });
return view;
}
Hashcode null object
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.hashCode()' on a null object reference
at bycsoftware.kitaplik_1.OzelAdaptor.getView(OzelAdaptor.java:78)
at android.widget.AbsListView.obtainView(AbsListView.java:2937)
at android.widget.ListView.measureHeightOfChildren(ListView.java:1305)
at android.widget.ListView.onMeasure(ListView.java:1212)
at android.view.View.measure(View.java:20214)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:716)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:462)
at android.view.View.measure(View.java:20214)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.view.View.measure(View.java:20214)
at android.support.v4.widget.DrawerLayout.onMeasure(DrawerLayout.java:1079)
at android.view.View.measure(View.java:20214)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:135)
at android.view.View.measure(View.java:20214)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
at android.support.v7.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:391)
at android.view.View.measure(View.java:20214)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.view.View.measure(View.java:20214)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:747)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:629)
at android.view.View.measure(View.java:20214)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at com.android.internal.policy.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:3083)
at android.view.View.measure(View.java:20214)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2683)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1636)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1928)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1524)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7520)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
at android.view.Choreographer.doCallbacks(Choreographer.java:686)
at android.view.Choreographer.doFrame(Choreographer.java:622)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
at android.os.Handler.handleCallback(Handler.java:739)