nullpointerexception

Can anyone help me identify the Exception in thread “AWT-EventQueue-0” java.lang.NullPointerException on Line 65?

空扰寡人 提交于 2019-12-31 07:15:13
问题 I keep getting a Run Time error that says I am having an Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException it is saying a [line 65] but to me it just looks like a basic if statement. I can give some background. this frame is call from a sequence of frames that is then once the state is selected sent to a new frame that contains states A-C cities. This current frame will work only when Alabama is not the state selected. (I have not created the other frames for the other

Send data from activity to fragment using Tab Layout with Swipeable Views in Android

别等时光非礼了梦想. 提交于 2019-12-31 07:04:10
问题 I created a Tab Layout with Swipeable Views using this tutorial. I'm trying to pass a string from Activity to Fragment. I read about fragment communication and couple other topics on stackoverflow but still i get null pointer exception. Here's my code: MainActivity.java public class MainActivity extends FragmentActivity { private static final int REQUEST_CODE_EMAIL = 1; String password, email; ViewPager viewPager; TabsPagerAdapter tabsPagerAdapter; ActionBar actionBar; @Override protected

View null inside fragment

大憨熊 提交于 2019-12-31 05:24:07
问题 I've been working on this for hours now. Can't find any reason. I can't post the entire fragment here but the following should make it clear. @BindView(R.id.acService) AutoCompleteTextView autocompleteService; @BindView(R.id.acAddress) AutoCompleteTextView autocompleteAddress; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_home, container, false); unbinder = ButterKnife.bind(this,

Camera “Bitmap imageBitmap = (Bitmap) extras.get(”data“);” gives Nullpointer error

醉酒当歌 提交于 2019-12-31 04:56:05
问题 I am following the Android developer tutorials on camera here: https://developer.android.com/training/camera/photobasics#java I however get an error in the method onActivityResult:,java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object android.os.Bundle.get(java.lang.String)' on a null object reference This line is giving the error: Bitmap imageBitmap = (Bitmap) extras.get("data"); Somehow when I comment out this line then the app works: takePictureIntent.putExtra

NullPointerException openOrCreateDatabase Android

只愿长相守 提交于 2019-12-31 04:53:04
问题 i m gettin a NullPointerException in my EhActivity class while opening a database public class EHActivity extends Activity { ArrayList<String>ques= new ArrayList<String>(); ArrayList<String>ans=new ArrayList<String>(); SQLiteDatabase db2; public ArrayList<String> getQues() { db2=openOrCreateDatabase("interview.db", MODE_PRIVATE, null); db2.execSQL("create table eh (qid int primary key,ques varchar,ans char)"); db2.execSQL("insert into subject values(1,'What is an exception?','A1 '))"); db2

Autowired Null Pointer Exception

假如想象 提交于 2019-12-31 04:01:06
问题 I have a filter to save requests to DB. But I get NullPointerException on autowired field: inboundRequestLogStore. I've tried the suggestion from Using some beans in Filter bean class? (I've added SpringBeanAutowiringSupport.processInjectionBasedOnServletContext(this, filterConfig.getServletContext()); to the filter init method and defined a bean in my root-context.xml ) and now it works for the RequestLogFilter class. But, in the InboundRequestLogStore class I have another autowired filed

I am getting nullpointer exception when I perform click() for the same WebElement which I have performed earlier in my Code

别说谁变了你拦得住时间么 提交于 2019-12-31 03:49:06
问题 I am getting some good handson on my Java ans Selenium. When I use the same "Input_Search_Box" Webelement to perform click method it throws a nullpointer exception. I have googled and tried few work around like adding Thread, adding Explicit wait but still no clue where i miss. Any suggestion would be greatly appreciated. Here is my Code: public class Testclass { WebElement Input_Search_Box; WebDriver driver; @Test public void openBrowser() throws Exception{ System.setProperty("webdriver

java.lang.NullPointerException : displaying records from database in an expandable listview

拜拜、爱过 提交于 2019-12-31 03:30:08
问题 As the question dictates, i need to display records from database, different record for each child.ie, child 1= record 1 data. child 2 =record 2 data.so and so. i came up with the following code for display: package com.example.moolah; import android.app.ListActivity; import android.content.Intent; import android.database.Cursor; import android.os.Bundle; import android.support.v4.widget.SimpleCursorAdapter; import android.view.View; import android.widget.Button; public class DisplayActivity

Null Pointer Exception while setting value of TextView in an Array Adapter class - Android

心已入冬 提交于 2019-12-31 02:41:07
问题 I'm getting a NullPointerException while trying to start an Activity which contains a ListView . In the getView method of the adapter class, the exception happens when the setText function of a textView is being called . The code bellow is my adapter class: public class QuestionsListAdapter extends ArrayAdapter<Question> { Context context; List<Question> questions; public QuestionsListAdapter(Context context, List<Question> questions){ super(context, R.layout.list_item_question, questions);

Clickable ListView

故事扮演 提交于 2019-12-30 13:41:29
问题 I'm looking now a few days for a solution for clickable items in a listView. First I came across this: developer.android.com/resources/articles/touch-mode.html and found that it's doesn't have the "normal" onListItemClick() behavouir. Then I came across of this code : http://www.androidsnippets.org/snippets/125/ // LINE 296-321 @Override protected ViewHolder createHolder(View v) { // createHolder will be called only as long, as the ListView is not filled // entirely. That is, where we gain