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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:20:59+00:00 2026-06-02T10:20:59+00:00

public class workmemo extends Activity{ EditText editTextWorkmemo1; EditText editTextWorkmemo2; String q1; String q2; Button

  • 0
public class workmemo extends Activity{

   EditText editTextWorkmemo1;
   EditText editTextWorkmemo2;
   String q1;
   String q2;

   Button ButtonWorkMemo1 ;
   WorkmemoDatabaseHelper dbh2 = new WorkmemoDatabaseHelper(workmemo.this);

   public void onCreate(Bundle savedInstanceState) {

      super.onCreate(savedInstanceState);
      setContentView(R.layout.workmemo);

      q1=editTextWorkmemo1.getText().toString();

      String currentDateTimeString = DateFormat.getDateTimeInstance().format(
                                                                   new Date());
      editTextWorkmemo2=(EditText)findViewById(R.id.editTextWorkmemo2);
      editTextWorkmemo2.setText(currentDateTimeString);
      q2=currentDateTimeString;

      ButtonWorkMemo1 = (Button) findViewById(R.id.ButtonWorkMemo1);
      ButtonWorkMemo1.setOnClickListener(new clicker());


   }

   class clicker implements Button.OnClickListener{
      public void onClick(View v) {                        
         if(v== ButtonWorkMemo1) {
            //addEvent(q1,q2);
            Intent viewDataIntent = new Intent(workmemo.this, Database.class);
            startActivity(viewDataIntent);
         }
      }
   }

    public void addEvent ( String q1,String q) {
       SQLiteDatabase db = dbh2.getWritableDatabase();
       ContentValues values = new ContentValues();

       values.put(WorkmemoDatabaseHelper.memo, q1);
       values.put(WorkmemoDatabaseHelper.date, q2);

       db.insert(WorkmemoDatabaseHelper.TABLE_NAME, null, values);      
    }
}

Hello , I am trying to launch an activity and when android tries to launch the above activity ( workmemo ) , it fails. Here is my error log below. any ideas?

04-24 12:46:06.955: W/dalvikvm(548): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
04-24 12:46:06.984: E/AndroidRuntime(548): FATAL EXCEPTION: main
04-24 12:46:06.984: E/AndroidRuntime(548): java.lang.RuntimeException: Unable to start activity ComponentInfo{nidhin.organizer/nidhin.organizer.workmemo}: java.lang.NullPointerException
04-24 12:46:06.984: E/AndroidRuntime(548):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
04-24 12:46:06.984: E/AndroidRuntime(548):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
04-24 12:46:06.984: E/AndroidRuntime(548):  at android.app.ActivityThread.access$600(ActivityThread.java:123)
04-24 12:46:06.984: E/AndroidRuntime(548):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
04-24 12:46:06.984: E/AndroidRuntime(548):  at android.os.Handler.dispatchMessage(Handler.java:99)
04-24 12:46:06.984: E/AndroidRuntime(548):  at android.os.Looper.loop(Looper.java:137)
04-24 12:46:06.984: E/AndroidRuntime(548):  at android.app.ActivityThread.main(ActivityThread.java:4424)
04-24 12:46:06.984: E/AndroidRuntime(548):  at java.lang.reflect.Method.invokeNative(Native Method)
04-24 12:46:06.984: E/AndroidRuntime(548):  at java.lang.reflect.Method.invoke(Method.java:511)
04-24 12:46:06.984: E/AndroidRuntime(548):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-24 12:46:06.984: E/AndroidRuntime(548):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-24 12:46:06.984: E/AndroidRuntime(548):  at dalvik.system.NativeStart.main(Native Method)
04-24 12:46:06.984: E/AndroidRuntime(548): Caused by: java.lang.NullPointerException
04-24 12:46:06.984: E/AndroidRuntime(548):  at nidhin.organizer.workmemo.onCreate(workmemo.java:32)
04-24 12:46:06.984: E/AndroidRuntime(548):  at android.app.Activity.performCreate(Activity.java:4465)
04-24 12:46:06.984: E/AndroidRuntime(548):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
04-24 12:46:06.984: E/AndroidRuntime(548):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
04-24 12:46:06.984: E/AndroidRuntime(548):  ... 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-06-02T10:21:00+00:00Added an answer on June 2, 2026 at 10:21 am

    Your variable editTextWorkmemo1 is unitialized but you’re calling getText() on it at line 32. This causes the NullPointerException.

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

Sidebar

Related Questions

public class IdAsync extends AsyncTask<String, Void, Void> { AlertDialog alertDialog = new AlertDialog.Builder(MainClass.this).create(); protected
public class FacebookConnect extends Activity { Facebook facebook = new Facebook(); String FILENAME =
public class HomeActivity extends Activity{ // public ArrayList<User> users1 = new ArrayList<User>(); @Override public
public class InterruptedInput { public static void main(String[] args) { InputThread th=new InputThread(); //worker
public class BobDatabase extends SQLiteOpenHelper{ private static final String DATABASE_NAME = bob.db; private static
public class Browser1Activity extends Activity { TextView url; WebView ourBrow; @Override protected void onCreate(Bundle
public class Base{ protected String str; public static final Base ERROR = new Base(error);
public class saveButtonListener implements ActionListener{ public void actionPerformed(ActionEvent ev){ JFileChooser chooser= new JFileChooser(); String
public class upload extends Activity { private static final int CAMERA_REQUEST = 1888; private
public class Buddy { public string[] Sayings; } Buddy one = new Buddy(); one.Sayings

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.