Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8636461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:14:08+00:00 2026-06-12T10:14:08+00:00

I am Using following code:- @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.newsfeed); setAllControlls();

  • 0

I am Using following code:-

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.newsfeed);
    setAllControlls();
     myPrefs = this.getSharedPreferences(
            AppConstants.MYPREF, MODE_WORLD_READABLE);
    userid = myPrefs.getString(AppConstants.USER_ID, "");

    if(checkInternet(NewFeeds.this))
    {
      new callNewsfeeddata().execute(userid);
    }
    else
    {
        Toast.makeText(NewFeeds.this,"Please Check Your Internet Connection",Toast.LENGTH_LONG).show();
    }

    objlistview.setOnRefreshListener(new OnRefreshListener() {

        @Override
        public void onRefresh() {
            if(checkInternet(NewFeeds.this))
            {
                new callNewsfeeddata().execute(userid);
            }
            else
            {
                Toast.makeText(NewFeeds.this,"Please Check Your Internet Connection",Toast.LENGTH_LONG).show();
            }
        }
    });

    objHandler = new Handler() {
        public void handleMessage(Message msg) {
            switch (msg.what) {
            case AppConstants.UPDATE_ADDRESS:
                if (!((String) msg.obj).equals("0")) {
                    System.out.println("inside---" + objlocationvalue);
                    objlocationvalue = (String) msg.obj;
                } else {
                    objlocationvalue = "1";
                }
                break;
            }
        }
    };
    objLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
}


private void setAllControlls() {

    objlistview = (PullToRefreshListView) findViewById(R.id.newsfeedlistview);
    objlistview.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1, int pos,
                long arg3) {

            int pos1=pos-1;

            NewsFeedModle objnewsfeedmodle = objlist.get(pos);
            String type = objnewsfeedmodle.getType();
            if(type.equalsIgnoreCase("job"))
            {
                String postid = objnewsfeedmodle.getJobId();
                Intent objintent = new Intent(NewFeeds.this,ShowNewPostJobDetails.class);
                Bundle objbundle = new Bundle();
                objbundle.putString("postid", postid);
                objbundle.putString("from","newsfeed");
                objintent.putExtras(objbundle);
                startActivity(objintent);
            }
            if(type.equalsIgnoreCase("deals"))
            {
                String postid = objnewsfeedmodle.getDealid();
                Intent objintent = new Intent(NewFeeds.this,ShowNewFindDeal.class);
                Bundle objbundle = new Bundle();
                objbundle.putString("postid", postid);
                objbundle.putString("from","newsfeed");
                objintent.putExtras(objbundle);
                startActivity(objintent);
            }
            if(type.equalsIgnoreCase("stuff"))
            {
                String postid = objnewsfeedmodle.getStuffId();
                Intent objintent = new Intent(NewFeeds.this,ShowNewFindStuff.class);
                Bundle objbundle = new Bundle();
                objbundle.putString("postid", postid);
                objbundle.putString("from","newsfeed");
                objintent.putExtras(objbundle);
                startActivity(objintent);
            }

        }
    });
}

private class callNewsfeeddata extends
        AsyncTask<String, Void, List<NewsFeedModle>> {
    ProgressDialog objprogress = new ProgressDialog(NewFeeds.this);
    AppRequestHandler objApprequest = new AppRequestHandler();

    List<NewsFeedModle> objresponce = new ArrayList<NewsFeedModle>();

    @Override
    protected void onPreExecute() {
        objprogress.setMessage("Please Wait While Loading...");
        objprogress.show();
    }

    @Override
    protected List<NewsFeedModle> doInBackground(String... params) {
        objresponce = objApprequest.newsFeedRequest(params[0]);
        return objresponce;
    }

    @Override
    protected void onPostExecute(List<NewsFeedModle> result) {
        if (objprogress.isShowing()) {
            objprogress.dismiss();
        }
        if(objlist!=null && objlist.size()!=0)
        {
            objlist.clear();    
        }
        String msgcount="";
        if (result != null) 
          {
            objlist=result;
            if(objlist.size()==0)
            {
                Log.i("check",""+objlist.size());
                Log.i("check22222",""+result.size());
            }
            if(objlist!=null && objlist.size()!=0)
            {
             msgcount = objlist.get(0).getMessagescount();  
            }
            TabActivity tab=(TabActivity) getParent();
            TextView tv=(TextView) tab.findViewById(R.id.notificationmsg);
            tv.setText(msgcount);
            Editor objedit = myPrefs.edit();
            objedit.putString(AppConstants.MESSAGECOUNT, msgcount);
            objedit.commit();
            objnewsFeedAdapter = new NewsFeedAdapter(NewFeeds.this,objlist,(float)objlattvalue,(float)objlongvalue,objlocationvalue);
            objlistview.setAdapter(objnewsFeedAdapter);
            objnewsFeedAdapter.notifyDataSetChanged();
            objlistview.onRefreshComplete();
        }
    }
}

I have define OnItemClickLIstener inside setAllContrill method but it is not working.listView is unclickable anyone suggest me .I am using github pulltorefresh code .I unable to find out what is issue because in other places it is working..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:14:08+00:00Added an answer on June 12, 2026 at 10:14 am

    Try: `

    objlistview.getRefreshableView().setOnItemClickListener(new OnItemClickListener...)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using following code to open Android Contacts @Override public void onCreate(Bundle savedInstanceState)
Using the guide on JSoup's website I wrote the following code: @Override public void
i am using following code. public class MyCount extends CountDownTimer { public MyCount(long millisInFuture,
i am using following code in my app: import android.app.Activity; import android.os.Bundle; import android.text.Html;
I am using the following code public class Img extends Activity { /** Called
Currently I am getting company name using following code public class ContactsDemo extends Activity
I have the following code in android - I'm using asmack API. public XMPPManager(String
I am Using Following Code to stop reloading the web page public class MainActivity
I am capturing an image using the following code public class PictureDemo extends Activity
Using following code I try to get updated list of checkbuttons' corresponding text values,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.