کلیدستان

نسخه‌ی کامل: طریقه فوریت کردن تکس ویو؟ (در برنامه نویسی اندروید)
شما در حال مشاهده نسخه آرشیو هستید. برای مشاهده نسخه کامل کلیک کنید.
باسلام.با استفاده از کدهای زیر توانستم لیست ویو(موضوعات کتاب) را فوریت (favorite) کنم .ولی در تکس ویو (صفحات کتاب)به مشکل برخوردم،کدهارا کمی تغییر دادم  ولی جواب نداد.چه تغییراتی باید در این کدها ایجاد کنم؟

کد پی‌اچ‌پی:
public class Favor extends ActionBarActivity  {
    
       
private String Name;
            private String Tedad;
            private String Fav;
            private List <String>items ;
        private ImageView next,pre;
        private TextView titr,matn,page;
        private database db;
        private String sea;
        
        protected void onCreate
(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.favor);
            
            Bundle ex
=getIntent().getExtras();
            sea=ex.getString("sea");
            
            refresh
();
            
}
        
        
public void View (final int position) {
            
            
            TextView name
=(TextViewfindViewById(R.id.textView1);
            TextView tedad=(TextViewfindViewById(R.id.textView2);
            
            final ImageView fav
=(ImageViewfindViewById(R.id.imageView1);
            
            if
(Fav[position].equals("1")){
                
                fav
.setImageResource(R.drawable.favon);
            }else{
                fav.setImageResource(R.drawable.favoff);
            }
            
            
            fav
.setOnClickListener(new OnClickListener() {
                
                
@Override
                public void onClick
(View arg0) {
                    // TODO Auto-generated method stub
                    
                    db
.open();
                    if(Fav[position].equals("1")){
                         
                        db
.fav_update("content"seaName[position], "0");
                        fav.setImageResource(R.drawable.favoff);
                        Fav[position]="0";
                    }else{
                        
                        db
.fav_update("content"seaName[position], "1");
                        fav.setImageResource(R.drawable.favon);
                        Fav[position]="1";
                    }
                    db.close();
                    
                
}
            });
            
            
            name
.setText(Name[position]);
            tedad.setText(Tedad[position] +" صفحه ");
            name.setTypeface(Main.font);
            
            
        
}
    
    
    
    
    
        private void refresh
(){
            
            db
.open();
            int s=db.Story_count("content"sea);
            
            Name
=new String[s];
            Tedad=new String[s];
            Fav=new String[s];
            
            for
(int i=0;i<s;i++){
                
                Name
[i]=db.Story_display("content"isea,1);
                Tedad[i]=db.Story_page_count("content"seaName[i].toString())+"";
                Fav[i]=db.Story_display("content"isea5);
        
            
}
            
            
            db
.close();
            
        
}