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 7965095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:03:36+00:00 2026-06-04T06:03:36+00:00

I am trying to refresh my custom ListViewAdapter; Edit : When I click an

  • 0

I am trying to refresh my custom ListViewAdapter;

Edit :

When I click an item in Listview it is calling the GoruntuleActivity’s screen and creating oncreate method (I am assuming it is creating..) and then I call a method of GoruntuleActivity and the layputInflater is into this Activity.

ListeleActivity.java

lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View item,
                    int position, long id) {

                onClickPosition = position;

                final Intent intent = new Intent(ListeleActivity.this,
                        GoruntuleActivity.class);
                startActivity(intent);

                goruntuleNesnesi.isSetListRefresh(onClickPosition , issetlist);
            }
        });

and it is calling the method of GoruntuleActivity.java

  public void isSetListRefresh(int onClickPosition, ArrayList<String> issetlist )
    {
        issetlist.set(onClickPosition, "false");
        setRecentOrSeen(issetlist);
        ListviewRefresh();
    }

    public void ListviewRefresh() 
    {
        LayoutInflater mLInflater = LayoutInflater.from(this);

        ListViewAdapter adapter = new ListViewAdapter(
                getApplicationContext(), getKimdenList(), getKonuList(), getRecentOrSeen() ,
                mLInflater);
        adapter.Remove();

    }

And now it is giving me another Exception..

05-18 16:25:22.073: E/AndroidRuntime(807): FATAL EXCEPTION: main
05-18 16:25:22.073: E/AndroidRuntime(807): java.lang.IllegalStateException: System services not available to Activities before onCreate()
05-18 16:25:22.073: E/AndroidRuntime(807):  at android.app.Activity.getSystemService(Activity.java:3526)
05-18 16:25:22.073: E/AndroidRuntime(807):  at android.view.LayoutInflater.from(LayoutInflater.java:171)
05-18 16:25:22.073: E/AndroidRuntime(807):  at com.mobil.eposta.GoruntuleActivity.ListviewRefresh(GoruntuleActivity.java:160)
05-18 16:25:22.073: E/AndroidRuntime(807):  at com.mobil.eposta.GoruntuleActivity.isSetListRefresh(GoruntuleActivity.java:155)
05-18 16:25:22.073: E/AndroidRuntime(807):  at com.mobil.eposta.ListeleActivity$1.onItemClick(ListeleActivity.java:137)
05-18 16:25:22.073: E/AndroidRuntime(807):  at android.widget.AdapterView.performItemClick(AdapterView.java:284)
05-18 16:25:22.073: E/AndroidRuntime(807):  at android.widget.ListView.performItemClick(ListView.java:3382)
05-18 16:25:22.073: E/AndroidRuntime(807):  at android.widget.AbsListView$PerformClick.run(AbsListView.java:1696)
05-18 16:25:22.073: E/AndroidRuntime(807):  at android.os.Handler.handleCallback(Handler.java:587)
05-18 16:25:22.073: E/AndroidRuntime(807):  at android.os.Handler.dispatchMessage(Handler.java:92)
05-18 16:25:22.073: E/AndroidRuntime(807):  at android.os.Looper.loop(Looper.java:123)
05-18 16:25:22.073: E/AndroidRuntime(807):  at android.app.ActivityThread.main(ActivityThread.java:4627)
05-18 16:25:22.073: E/AndroidRuntime(807):  at java.lang.reflect.Method.invokeNative(Native Method)
05-18 16:25:22.073: E/AndroidRuntime(807):  at java.lang.reflect.Method.invoke(Method.java:521)
05-18 16:25:22.073: E/AndroidRuntime(807):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-18 16:25:22.073: E/AndroidRuntime(807):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-18 16:25:22.073: E/AndroidRuntime(807):  at dalvik.system.NativeStart.main(Native Method)
  • 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-04T06:03:37+00:00Added an answer on June 4, 2026 at 6:03 am

    From the error logs, it looks like getApplicationContext() is returning null. When are you calling goruntuleNesnesi.ListviewRefresh();? Is it in the onCreate(…)? If so, that may be your problem as getApplicationContext(...) will return null until onCreate(...) is done initializing.

    Edit: I looked through the stack trace a bit more and it looks like you’re calling ListviewRefresh on a button click. Have you tried using this instead of getApplicationContext(…)?

    Edit 2: Try this:

    ListViewAdapter adapter = new ListViewAdapter(this, getKimdenList(), getKonuList(), getRecentOrSeen() ,mLInflater); 
    

    Although, I think it may suffer from the same problem because the activity hasn’t been drawn on the screen yet and hasn’t been initialized, you can’t inflate views on it. Try it out and we’ll go from there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working on figuring out my NullPointerException within my custom simplecursoradapter when trying to refresh
Am trying to implement chrisbane's pull-to-refresh library for my ListView (https://github.com/chrisbanes/Android-PullToRefresh). It seems simple
I'm trying to delete items from a ListView using a custom adapter which extends
im trying to refresh a div on the page using jquery after a click
I'm trying to refresh a page without sending POST from the previous time. I've
I am trying to refresh a UITableView with new cells every 30 seconds. My
Goal: I'm trying to refresh content inside a div so that if the user
I am trying to refresh the page after a cgi execution. In my cgi,
Durning the weekend I'm trying to refresh my c++ skills and learn some c++11,
I have an application in which I am trying to refresh the list after

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.