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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:29:56+00:00 2026-05-30T20:29:56+00:00

I am trying to use this code: When I am clicking on a imageButton,

  • 0

I am trying to use this code:

  1. When I am clicking on a imageButton, this will execute the goJournalArticles(View v) method:

    public void goJournalArticles(View v)
    {
    new DownoadJournalsFinishedAsync().execute();
    }
    

Then, I am doing some things and during this, I am showing the progressDialog:

class DownoadJournalsFinishedAsync extends AsyncTask<String, String, ArrayList<String>> {
    ProgressDialog dialog = new ProgressDialog(Journals.this);

    @Override
    protected void onPreExecute() {
        super.onPreExecute();
        dialog.setMessage("Loading Articles. Please wait...");
        dialog.setCancelable(false);
        dialog.show();
    }

    @Override
    protected ArrayList<String> doInBackground(String... aurl) {
        String journalNameShort = localDatabase.getHistoryLastSelectedJournal();
        int journalId = localDatabase.getJournalIdFromNameShort(journalNameShort);
        ArrayList<String> result = new ArrayList<String>();

            try {
                infoCourrentIssue = serviceMDPI.JournalCurrentIssue(journalId);
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            int issue =infoCourrentIssue.getIssue();
            int volume = infoCourrentIssue.getVolume();
            ArrayList<Article> articles = GetCurrentIssue(journalId,volume,issue);
            int size = articles.size();

            for (int i=0;i<size;i++)
            {
                result.add(Html.fromHtml(articles.get(i).getTitle()).toString());
            }
            return result;
    }

     @Override
     protected void onPostExecute(ArrayList<String> result) {
         //View v = findViewById(R.id.Articles);
            Intent myIntent = new Intent(getBaseContext(), JournalArticles.class);
            myIntent.putExtra("articlesTitle", result); 
            startActivityForResult(myIntent, 0);
            dialog.dismiss();
     }
 }

But When I am trying to open a new activity with the intent, I am gotting this error:

03-05 12:08:47.724: E/AndroidRuntime(22249): FATAL EXCEPTION: main
03-05 12:08:47.724: E/AndroidRuntime(22249): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{milos.mdpi/milos.mdpi.JournalArticles}: java.lang.NullPointerException
03-05 12:08:47.724: E/AndroidRuntime(22249):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1785)
03-05 12:08:47.724: E/AndroidRuntime(22249):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1893)
03-05 12:08:47.724: E/AndroidRuntime(22249):    at android.app.ActivityThread.access$1500(ActivityThread.java:135)
03-05 12:08:47.724: E/AndroidRuntime(22249):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1054)
03-05 12:08:47.724: E/AndroidRuntime(22249):    at android.os.Handler.dispatchMessage(Handler.java:99)
03-05 12:08:47.724: E/AndroidRuntime(22249):    at android.os.Looper.loop(Looper.java:150)
03-05 12:08:47.724: E/AndroidRuntime(22249):    at android.app.ActivityThread.main(ActivityThread.java:4389)
03-05 12:08:47.724: E/AndroidRuntime(22249):    at java.lang.reflect.Method.invokeNative(Native Method)
03-05 12:08:47.724: E/AndroidRuntime(22249):    at java.lang.reflect.Method.invoke(Method.java:507)
03-05 12:08:47.724: E/AndroidRuntime(22249):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)
03-05 12:08:47.724: E/AndroidRuntime(22249):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
03-05 12:08:47.724: E/AndroidRuntime(22249):    at dalvik.system.NativeStart.main(Native Method)
03-05 12:08:47.724: E/AndroidRuntime(22249): Caused by: java.lang.NullPointerException
03-05 12:08:47.724: E/AndroidRuntime(22249):    at android.app.Activity.findViewById(Activity.java:1732)
03-05 12:08:47.724: E/AndroidRuntime(22249):    at milos.mdpi.JournalArticles.<init>(JournalArticles.java:13)
03-05 12:08:47.724: E/AndroidRuntime(22249):    at java.lang.Class.newInstanceImpl(Native Method)
03-05 12:08:47.724: E/AndroidRuntime(22249):    at java.lang.Class.newInstance(Class.java:1409)
03-05 12:08:47.724: E/AndroidRuntime(22249):    at android.app.Instrumentation.newActivity(Instrumentation.java:1040)
03-05 12:08:47.724: E/AndroidRuntime(22249):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1777)
03-05 12:08:47.724: E/AndroidRuntime(22249):    ... 11 more
  • 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-05-30T20:29:58+00:00Added an answer on May 30, 2026 at 8:29 pm

    I have found the solution, the problem was on my second activity class.

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

Sidebar

Related Questions

Trying to use this code to connect the AD PrincipalContext context = new PrincipalContext(ContextType.Domain,
i am trying to use this code to bind my asp.net menu control to
I'm trying to use this code to replace spaces with _, it works for
i am trying to use this code: <%= File.ReadAllText(Server.MapPath(Members/newsletters/welcome.html))%> which works great but now
I am trying to use this code in my QT app QMap<QString,QMap> but there
I'm trying to use this fairly standard line of code in my app: [[UIApplication
I'm trying to build multilangual site. I use this piece of code to detect
Trying to use this method (gist of which is use self.method_name in the FunnyHelper
I am trying to use the code in this article that lets you know
Im trying to use this code: <script> jQuery('#MySelectorDiv').fadeTo(500,0.2); </script> To fade out a bunch

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.