Search Results

Search found 5 results on 1 pages for 'geekedout'.

Page 1/1 | 1 

  • Android - updating a list adapter creates a NullPointException

    - by GeekedOut
    I have a ListActivity which has an adapter that crashes. Here is the code that crashes the program: Question q = new Question (); q.setQuestion( "" ); questions.add(q); adapter = new ArrayAdapter<Question>(this, R.layout.user_question_list, R.id.label, questions); Here is how I create the adapter: ArrayAdapter<Question> adapter; ArrayList<Question> questions = new ArrayList <Question>( ); and the list xml is like this: <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="10dp" android:textSize="16sp" > </TextView> and the overall Activity xml is like this: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" > <TextView android:id="@+id/question_label" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Loading your questions..." /> <ListView android:id="@android:id/list" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@+id/label" android:textSize="20px" > </ListView> <Button android:id="@+id/add_question" android:layout_height="wrap_content" android:text="Ask a Question" android:onClick="sendFeedback" android:layout_width="fill_parent"> </Button> </LinearLayout> Any idea why the code where I try to update the adapter results in the NullPointerException? Thanks!!

    Read the article

  • ios - compile error: redefinition of label openURL

    - by GeekedOut
    I have a method like this: - (BOOL)webView:(UIWebView *)aWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { if ([request.URL.scheme isEqualToString:@"aaa"]) { openURL:[NSURL URLWithString:@"www.firstwebsite.com"]; } if ([request.URL.scheme isEqualToString:@"abc"]) { openURL:[NSURL URLWithString:@"http://www.someurl.com"]; } if ([request.URL.scheme isEqualToString:@"xyz"]) { openURL:[NSURL URLWithString:@"http://www.anothersite.com"]; } return YES; } and on the second and third uses of openURL I get a compile error: redefinition of label openURL Any idea why that happens and how to resolve it? Thanks!

    Read the article

  • Android InAppBilling - what to do when user presses the buy button?

    - by GeekedOut
    I set up the "Dungeons" InAppBilling example locally and I am ready to try it out, but I am a bit confused. I have a button like this: Button donate = (Button)findViewById(R.id.donate); donate.setOnClickListener(new Button.OnClickListener() { public void onClick(View v) { // But what do I do here? :) } }); And when it is called, what do I need to do to actually go to the pay screen on android store? Thanks!

    Read the article

  • Android - exception from an AsynchTask call

    - by GeekedOut
    I have an Activity that makes a remote server call and tries to populate a list. The call to the server works fine, and the call returns some JSON which is good. But then the system throws this exception: 04-06 18:43:19.626: D/AndroidRuntime(2564): Shutting down VM 04-06 18:43:19.626: W/dalvikvm(2564): threadid=1: thread exiting with uncaught exception (group=0x409c01f8) 04-06 18:43:19.686: E/AndroidRuntime(2564): FATAL EXCEPTION: main 04-06 18:43:19.686: E/AndroidRuntime(2564): java.lang.NullPointerException 04-06 18:43:19.686: E/AndroidRuntime(2564): at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:394) 04-06 18:43:19.686: E/AndroidRuntime(2564): at android.widget.ArrayAdapter.getView(ArrayAdapter.java:362) 04-06 18:43:19.686: E/AndroidRuntime(2564): at android.widget.AbsListView.obtainView(AbsListView.java:2033) 04-06 18:43:19.686: E/AndroidRuntime(2564): at android.widget.ListView.measureHeightOfChildren(ListView.java:1244) 04-06 18:43:19.686: E/AndroidRuntime(2564): at android.widget.ListView.onMeasure(ListView.java:1155) 04-06 18:43:19.686: E/AndroidRuntime(2564): at android.view.View.measure(View.java:12723) 04-06 18:43:19.686: E/AndroidRuntime(2564): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4698) 04-06 18:43:19.686: E/AndroidRuntime(2564): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1369) 04-06 18:43:19.686: E/AndroidRuntime(2564): at android.widget.LinearLayout.measureVertical(LinearLayout.java:660) 04-06 18:43:19.686: E/AndroidRuntime(2564): at android.widget.LinearLayout.onMeasure(LinearLayout.java:553) 04-06 18:43:19.686: E/AndroidRuntime(2564): at android.view.View.measure(View.java:12723) 04-06 18:43:19.686: E/AndroidRuntime(2564): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4698) 04-06 18:43:19.686: E/AndroidRuntime(2564): at android.widget.FrameLayout.onMeasure(FrameLayout.java:293) 04-06 18:43:19.686: E/AndroidRuntime(2564): at android.view.View.measure(View.java:12723) 04-06 18:43:19.686: E/AndroidRuntime(2564): at android.widget.LinearLayout.measureVertical(LinearLayout.java:812) 04-06 18:43:19.686: E/AndroidRuntime(2564): at android.widget.LinearLayout.onMeasure(LinearLayout.java:553) 04-06 18:43:19.686: E/AndroidRuntime(2564): at android.view.View.measure(View.java:12723) 04-06 18:43:19.686: E/AndroidRuntime(2564): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4698) 04-06 18:43:19.686: E/AndroidRuntime(2564): at android.widget.FrameLayout.onMeasure(FrameLayout.java:293) 04-06 18:43:19.686: E/AndroidRuntime(2564): at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2092) 04-06 18:43:19.686: E/AndroidRuntime(2564): at android.view.View.measure(View.java:12723) 04-06 18:43:19.686: E/AndroidRuntime(2564): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1064) 04-06 18:43:19.686: E/AndroidRuntime(2564): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2442) 04-06 18:43:19.686: E/AndroidRuntime(2564): at android.os.Handler.dispatchMessage(Handler.java:99) 04-06 18:43:19.686: E/AndroidRuntime(2564): at android.os.Looper.loop(Looper.java:137) 04-06 18:43:19.686: E/AndroidRuntime(2564): at android.app.ActivityThread.main(ActivityThread.java:4424) 04-06 18:43:19.686: E/AndroidRuntime(2564): at java.lang.reflect.Method.invokeNative(Native Method) 04-06 18:43:19.686: E/AndroidRuntime(2564): at java.lang.reflect.Method.invoke(Method.java:511) 04-06 18:43:19.686: E/AndroidRuntime(2564): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 04-06 18:43:19.686: E/AndroidRuntime(2564): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 04-06 18:43:19.686: E/AndroidRuntime(2564): at dalvik.system.NativeStart.main(Native Method) Why would this happen? It doesn't point to any of my code so its a bit strange. the protected void onPostExecute(String result) never gets called on the callback. Thanks!

    Read the article

  • ios - how do I concatinate strings to create a url?

    - by GeekedOut
    I am trying to make a url by first collecting the parameters, and then in one statement creating the actual url. Here is what I am trying to do: NSString *urlString = @"http://www.some_login_url.com?email=%@&password=%@"; NSString *email = self.email.text; NSString *password = self.password.text; NSString *url_to_send = [NSString stringWithFormat:@"%@%@", urlString , email , password]; So what I wanted to do was replace the @ symbols with the values in the variables, but instead the second variable just got appended to the end of the string. How would I change the last line so I could put the right parameters in their correct spots? Thanks!!

    Read the article

1