Search Results

Search found 17 results on 1 pages for 'dixieflatline'.

Page 1/1 | 1 

  • Android exception i don't understand after loading webpage in a webview

    - by DixieFlatline
    I have a webview that loads a webpage. I also have a reload button. Sometimes it works but sometimes it crashes when i hit reload and i get this exceptions: 05-14 10:08:33.958: ERROR/WindowManager(918): Activity com.poslji.gor.Uvod has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@435da698 that was originally added here 05-14 10:08:33.958: ERROR/WindowManager(918): android.view.WindowLeaked: Activity com.poslji.gor.Uvod has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@435da698 that was originally added here 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.ViewRoot.(ViewRoot.java:217) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.Window$LocalWindowManager.addView(Window.java:392) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.app.Dialog.show(Dialog.java:231) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.app.ProgressDialog.show(ProgressDialog.java:107) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.app.ProgressDialog.show(ProgressDialog.java:90) 05-14 10:08:33.958: ERROR/WindowManager(918): at com.poslji.gor.Odgovori$2.onClick(Odgovori.java:120) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.View.performClick(View.java:2179) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.View.onTouchEvent(View.java:3828) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.widget.TextView.onTouchEvent(TextView.java:6307) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.View.dispatchTouchEvent(View.java:3368) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903) 05-14 10:08:33.958: ERROR/WindowManager(918): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1752) 05-14 10:08:33.958: ERROR/WindowManager(918): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1206) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.app.Activity.dispatchTouchEvent(Activity.java:1997) 05-14 10:08:33.958: ERROR/WindowManager(918): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1736) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903) 05-14 10:08:33.958: ERROR/WindowManager(918): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1752) 05-14 10:08:33.958: ERROR/WindowManager(918): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1206) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.app.Activity.dispatchTouchEvent(Activity.java:1997) 05-14 10:08:33.958: ERROR/WindowManager(918): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1736) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.view.ViewRoot.handleMessage(ViewRoot.java:1761) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.os.Handler.dispatchMessage(Handler.java:99) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.os.Looper.loop(Looper.java:123) 05-14 10:08:33.958: ERROR/WindowManager(918): at android.app.ActivityThread.main(ActivityThread.java:3948) 05-14 10:08:33.958: ERROR/WindowManager(918): at java.lang.reflect.Method.invokeNative(Native Method) 05-14 10:08:33.958: ERROR/WindowManager(918): at java.lang.reflect.Method.invoke(Method.java:521) 05-14 10:08:33.958: ERROR/WindowManager(918): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782) 05-14 10:08:33.958: ERROR/WindowManager(918): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) 05-14 10:08:33.958: ERROR/WindowManager(918): at dalvik.system.NativeStart.main(Native Method) 05-14 10:08:36.768: ERROR/AndroidRuntime(918): Uncaught handler: thread main exiting due to uncaught exception 05-14 10:08:36.778: ERROR/AndroidRuntime(918): java.lang.IllegalArgumentException: View not attached to window manager 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:356) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:201) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at android.view.Window$LocalWindowManager.removeView(Window.java:400) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at android.app.Dialog.dismissDialog(Dialog.java:268) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at android.app.Dialog.access$000(Dialog.java:69) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at android.app.Dialog$1.run(Dialog.java:103) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at android.app.Dialog.dismiss(Dialog.java:252) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at com.poslji.gor.Odgovori$HelloWebViewClient.onPageFinished(Odgovori.java:180) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:225) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at android.os.Handler.dispatchMessage(Handler.java:99) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at android.os.Looper.loop(Looper.java:123) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at android.app.ActivityThread.main(ActivityThread.java:3948) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at java.lang.reflect.Method.invokeNative(Native Method) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at java.lang.reflect.Method.invoke(Method.java:521) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) 05-14 10:08:36.778: ERROR/AndroidRuntime(918): at dalvik.system.NativeStart.main(Native Method) What is going wrong here?

    Read the article

  • Android relative layout problem

    - by DixieFlatline
    Hello! I just can't display the button at the bottom of the screen. I have 2 textviews and 2 edittexts set as gone, and they become visible when user clicks checkbox. It's only then that my button gets positioned properly Otherwise it sits on top of the app at launch of my app.(see here: http://www.shrani.si/f/3V/10G/4nnH4DtV/layoutproblem.png) I also tried android:layout_alignParentBottom="true" but that doesnt help either. <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/scrollview" android:layout_width="fill_parent" android:layout_height="wrap_content"> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:id="@+id/txt1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Krajevna skupnost: " android:layout_alignParentTop="true" /> <Spinner android:id="@+id/spinner1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:prompt="@string/ks_prompt" android:layout_below="@id/txt1" /> <TextView android:id="@+id/txt2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Zadeva: " android:layout_below="@id/spinner1" /> <Spinner android:id="@+id/spinner2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:prompt="@string/pod_prompt" android:layout_below="@id/txt2" /> <TextView android:id="@+id/tv1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Zadeva: " android:layout_below="@id/spinner2" /> <EditText android:id="@+id/prvi" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/tv1" /> <TextView android:id="@+id/tv2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/prvi" android:text="Vsebina: " /> <EditText android:id="@+id/drugi" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/tv2" /> <CheckBox android:id="@+id/cek" android:text="Obvešcaj o odgovoru" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/drugi" /> <TextView android:id="@+id/tv3" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/cek" android:text="Email: " android:visibility="gone"/> <EditText android:id="@+id/tretji" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/tv3" android:visibility="gone" /> <TextView android:id="@+id/tv4" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/tretji" android:visibility="gone" android:text="Telefon: " /> <EditText android:id="@+id/cetrti" android:layout_width="fill_parent" android:layout_height="wrap_content" android:visibility="gone" android:layout_below="@id/tv4" /> <Button android:id="@+id/gumb" android:text="Klikni" android:typeface="serif" android:textStyle="bold" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" android:layout_below="@id/cetrti" /> </RelativeLayout> </ScrollView>

    Read the article

  • Android multiple spinners

    - by DixieFlatline
    Hello! I have 3 spinners (dropdown menus). I would like the user to select item from the first one and that would determine the options(different string array) on the second and on the third spinner. E.g. user selects the country in the first spinner and then gets popular music groups in that country on the second spinner and popular dishes on the third. What is the easiest way to do this?

    Read the article

  • Linear layout and custom dialog

    - by DixieFlatline
    The button doesn't show in this layout(code below),image and textview are shown. I tried using relative layout but that doesn't help either. I'm testing it on 1.5 emulator. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/layout_root" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="10dp" > <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/neki" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ImageView android:id="@+id/image" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginRight="10dp" /> <TextView android:id="@+id/text" android:layout_width="wrap_content" android:layout_height="fill_parent" android:textColor="#FFF" android:text="Some text " /> </LinearLayout> <Button android:id="@+id/gumbek" android:text="V redu" android:typeface="serif" android:textStyle="bold" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </LinearLayout>

    Read the article

  • Problem with sizes of EditText and Button in Android

    - by DixieFlatline
    I want to make the edittext width the same size as button. My EditText is currently very small. I use relative layout. <TextView android:id="@+id/aha4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="17dip" android:text="Vzdevek:" android:layout_below="@id/aha3" /> <EditText android:id="@+id/nick" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_below="@id/nivo" android:layout_toRightOf="@id/aha4"/> <Button android:id="@+id/poslji" android:text="Pošlji" android:layout_height="wrap_content" android:layout_width="20dip" android:typeface="serif" android:textStyle="bold" android:layout_alignParentRight="true" android:layout_below="@id/nivo" android:layout_toRightOf="@id/nick"/> What i currently get is this: What is the appropriate layout_width for edittext and button?

    Read the article

  • App starts in 1.5 emulator but doesn't in 1.6

    - by DixieFlatline
    My app works on 1.5 emulator and 1.5 device. When i try to start it on 1.6 emulator, it produces strange exceptions (doesn't even start). I don't have any 1.6 device to try this app if it works on a real device. I get some warnings in Eclipse ( warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. This class was probably produced by a broken compiler.) and get cant rid of them (i think they come from some apache jars that i need to make http multipart posts). Is it possible that this jars are cause for my exceptions in 1.6 or is it something else? My logacat: 04-29 16:14:55.874: ERROR/AndroidRuntime(392): Uncaught handler: thread main exiting due to uncaught exception 04-29 16:14:55.894: ERROR/AndroidRuntime(392): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.poslji.gor/com.poslji.gor.FormFiller}: java.lang.NumberFormatException: unable to parse 'null' as integer 04-29 16:14:55.894: ERROR/AndroidRuntime(392): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401) 04-29 16:14:55.894: ERROR/AndroidRuntime(392): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417) 04-29 16:14:55.894: ERROR/AndroidRuntime(392): at android.app.ActivityThread.access$2100(ActivityThread.java:116) 04-29 16:14:55.894: ERROR/AndroidRuntime(392): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794) 04-29 16:14:55.894: ERROR/AndroidRuntime(392): at android.os.Handler.dispatchMessage(Handler.java:99) 04-29 16:14:55.894: ERROR/AndroidRuntime(392): at android.os.Looper.loop(Looper.java:123) 04-29 16:14:55.894: ERROR/AndroidRuntime(392): at android.app.ActivityThread.main(ActivityThread.java:4203) 04-29 16:14:55.894: ERROR/AndroidRuntime(392): at java.lang.reflect.Method.invokeNative(Native Method) 04-29 16:14:55.894: ERROR/AndroidRuntime(392): at java.lang.reflect.Method.invoke(Method.java:521) 04-29 16:14:55.894: ERROR/AndroidRuntime(392): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 04-29 16:14:55.894: ERROR/AndroidRuntime(392): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 04-29 16:14:55.894: ERROR/AndroidRuntime(392): at dalvik.system.NativeStart.main(Native Method) 04-29 16:14:55.894: ERROR/AndroidRuntime(392): Caused by: java.lang.NumberFormatException: unable to parse 'null' as integer 04-29 16:14:55.894: ERROR/AndroidRuntime(392): at java.lang.Integer.parseInt(Integer.java:358) 04-29 16:14:55.894: ERROR/AndroidRuntime(392): at java.lang.Integer.parseInt(Integer.java:333) 04-29 16:14:55.894: ERROR/AndroidRuntime(392): at com.poslji.gor.FormFiller.nastavi(FormFiller.java:322) 04-29 16:14:55.894: ERROR/AndroidRuntime(392): at com.poslji.gor.FormFiller.onCreate(FormFiller.java:188) 04-29 16:14:55.894: ERROR/AndroidRuntime(392): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123) 04-29 16:14:55.894: ERROR/AndroidRuntime(392): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)

    Read the article

  • Launching MapActivity from another activity

    - by DixieFlatline
    Hello! I have 1 activity and 1 class that extends MapActivity(Lokacija). I added MapActivity to manifest, this line and my build configuration is set to Google API. I want to launch the mapactivity with the press of a button as usually: final Intent i = new Intent(); intent.setClass(getApplicationContext(), Lokacija.class); startactivity(i);ode here When i click on a button, I get android runtime exception (no activity found to handle intent). I has to be something with class extending MapActivity, but i don't know what. Any suggestions?

    Read the article

  • Why do i get exc bad access in cases when object is not nil?

    - by DixieFlatline
    I have an app that receives remote notifications. My view controller that is shown after push has a tableview. App crashes very randomly (1 in 20 tries) at line setting frame: if (!myTableView) { NSLog(@"self.myTableView is nil"); } myTableView.frame=CGRectMake(0, 70, 320, 376); This only happens when i open the app, then open some other apps and then receive the push notification. I guess it has something to do with memory. I use ARC (ios 5). The strange thing is that nslog is not displayed, so tableview is not nil. Crash log: Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x522d580c Crashed Thread: 0 Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 libobjc.A.dylib 0x352b1f7e objc_msgSend + 22 1 Foundation 0x37dc174c NSKVOPendingNotificationCreate + 216 2 Foundation 0x37dc1652 NSKeyValuePushPendingNotificationPerThread + 62 3 Foundation 0x37db3744 NSKeyValueWillChange + 408 4 Foundation 0x37d8a848 -[NSObject(NSKeyValueObserverNotification) willChangeValueForKey:] + 176 5 Foundation 0x37e0ca14 _NSSetPointValueAndNotify + 76 6 UIKit 0x312af25a -[UIScrollView(Static) _adjustContentOffsetIfNecessary] + 1890 7 UIKit 0x312cca54 -[UIScrollView setFrame:] + 548 8 UIKit 0x312cc802 -[UITableView setFrame:] + 182 9 POViO 0x000913cc -[FeedVC viewWillAppear:] (FeedVC.m:303) Dealloc is not called because it is not logged: - (void)dealloc { NSLog(@"dealloc"); }

    Read the article

  • AutoCompleteTextView showing suggestions only for the first word entered

    - by DixieFlatline
    Hello! My autocompletetextview shows suggestions only for the first entered word. So if i write "ki" suggestions for king will popup. But if i enter "queen whitespace ki" there will be no suggestion for king. textView = (AutoCompleteTextView) findViewById(R.id.predlogi); String[] pred = getResources().getStringArray(R.array.predlogi); ArrayAdapter adapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, pred); textView.setAdapter(adapter); textView.setThreshold(2); Is there any property that should be set to textView?

    Read the article

  • How to display characters in http get response correctly with the right encoding

    - by DixieFlatline
    Hello! Does anyone know how to read c,š,ž characters in http get response properly? When i make my request in browser the browser displays all characters correctly. But in java program with apache jars i don't know how to set the encoding right. I tried with client.getParams().setParameter(CoreProtocolPNames.HTTP_CONTENT_CHARSET, "UTF-8"); but it's not working. My code: HttpClient client = new DefaultHttpClient(); String getURL = "http://www.google.com"; HttpGet get = new HttpGet(getURL); HttpResponse responseGet = client.execute(get); HttpEntity resEntityGet = responseGet.getEntity(); if (resEntityGet != null) { Log.i("GET RESPONSE",EntityUtils.toString(resEntityGet)); } } catch (Exception e) { e.printStackTrace(); }

    Read the article

  • Show/hide views with checkbox

    - by DixieFlatline
    Hi! I want to show or hide some elements (textviews and edittexts) with checkbox. I set their visibility to gone in layout file. Showing them when user checks the box works, but the when user unchecks it, they don't hide. (android 1.5 and 1.6) My code: cb=(CheckBox)findViewById(R.id.cek); cb.setOnClickListener(new OnClickListener() { // checkbox listener public void onClick(View v) { // Perform action on clicks, depending on whether it's now checked if (((CheckBox) v).isChecked()) { tv1.setVisibility(0); //visible==0 et3.setVisibility(0); } else if (((CheckBox) v).isChecked() == false) { tv1.setVisibility(2); //gone=2 et3.setVisibility(2); } } });

    Read the article

  • Getting coordinates when clicking anywhere on a MapView

    - by DixieFlatline
    I just cant get this working. I tried using the code below with onTouchEventand and it doesn't work. If i return true at the end of the method, i get the toast with the coordinates but can't move a map, and if i return false, i can move a map but cant display a toast after the user clicks on a map. If i get it right, the other onTap method is used only for clicking on a overlays. Has anybody figured this thiing out? public boolean onTouchEvent(MotionEvent arg0, MapView arg1) { //super.onTouchEvent(arg0); int akcija = arg0.getAction(); if(akcija == MotionEvent.ACTION_UP){ if(!premik) { Projection proj = mapView.getProjection(); GeoPoint loc = proj.fromPixels((int)arg0.getX(), (int)arg0.getY()); String sirina=Double.toString(loc.getLongitudeE6()/1000000); String dolzina=Double.toString(loc.getLatitudeE6()/1000000); Toast toast = Toast.makeText(getApplicationContext(), "Širina: "+sirina+" Dolzina: "+dolzina, Toast.LENGTH_LONG); toast.show(); } } else if (akcija == MotionEvent.ACTION_DOWN){ premik= false; } else if (akcija== MotionEvent.ACTION_MOVE){ premik = true; } return false; //return super.onTouchEvent(arg0); }

    Read the article

  • Setting spinners onResume doesn't work

    - by DixieFlatline
    Hello! I want to save text from 2 edittexts(et1,et2) and selection from 3 spinners(spinnerm,spinner and spinner2) onPause and setting them back onResume. Text from edittexts is saved correctly, only spinner selection don't work as desired. My code: public void onResume(){ super.onResume(); Log.d("REZUM","notr smo"); SharedPreferences seti = getSharedPreferences( "pavzica", MODE_PRIVATE); spinnerm.setSelection(seti.getInt("m", 0)); spinner.setSelection(seti.getInt("k", 0)); spinner2.setSelection(seti.getInt("p", 0)); et1.setText(seti.getString("zade", "")); et2.setText(seti.getString("Vseb", "")); } public void onPause() { shraniPolja(); super.onPause(); } public void shraniPolja() { SharedPreferences seti = getSharedPreferences( "pavzica", MODE_PRIVATE); SharedPreferences.Editor edito = seti.edit(); edito.putString("zade", et1.getText().toString()); edito.putString("Vseb", et2.getText().toString()); edito.putInt("m", spinnerm.getSelectedItemPosition()); edito.putInt("k", spinner.getSelectedItemPosition()); edito.putInt("p", spinner2.getSelectedItemPosition()); edito.putBoolean("b", true); edito.commit(); } What am i doing wrong?

    Read the article

  • NfcAdapter.getDefaultAdapter(this) returns null in emulator

    - by DixieFlatline
    I am trying to test ForegroundDispatch (http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/nfc/ForegroundDispatch.html) in emulator API 10 (Android 2.3.3). When i call NfcAdapter.getDefaultAdapter(this), i get null. Why is this so? Code: public class ForegroundDispatch extends Activity { private NfcAdapter mAdapter; private PendingIntent mPendingIntent; private IntentFilter[] mFilters; private String[][] mTechLists; private TextView mText; private int mCount = 0; @Override public void onCreate(Bundle savedState) { super.onCreate(savedState); setContentView(R.layout.foreground_dispatch); mText = (TextView) findViewById(R.id.text); mText.setText("Scan a tag"); mAdapter = NfcAdapter.getDefaultAdapter(this); // Create a generic PendingIntent that will be deliver to this activity. The NFC stack // will fill in the intent with the details of the discovered tag before delivering to // this activity. mPendingIntent = PendingIntent.getActivity(this, 0, new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0); // Setup an intent filter for all MIME based dispatches IntentFilter ndef = new IntentFilter(NfcAdapter.ACTION_NDEF_DISCOVERED); try { ndef.addDataType("*/*"); } catch (MalformedMimeTypeException e) { throw new RuntimeException("fail", e); } mFilters = new IntentFilter[] { ndef, }; // Setup a tech list for all NfcF tags mTechLists = new String[][] { new String[] { NfcF.class.getName() } }; } @Override public void onResume() { super.onResume(); mAdapter.enableForegroundDispatch(this, mPendingIntent, mFilters, mTechLists); //CRASHES HERE BECAUSE mAdapter IS NULL } @Override public void onNewIntent(Intent intent) { Log.i("Foreground dispatch", "Discovered tag with intent: " + intent); mText.setText("Discovered tag " + ++mCount + " with intent: " + intent); } @Override public void onPause() { super.onPause(); mAdapter.disableForegroundDispatch(this); } } My manifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.neka.znacka" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="10" /> <uses-permission android:name="android.permission.NFC"></uses-permission> <uses-feature android:name="android.hardware.nfc" android:required="true" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".Uvodna" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="Simulator"> </activity> </application> Any ideas?

    Read the article

  • Getting all the cookies including those from google analytics from one webpage

    - by DixieFlatline
    Hello! I use apache 4 java libs for http get connections. I get all cookies from 2 other pages. But one other webpage contains google analytics cookies(utma,utmz...) and classic session id cookie (checked with firebug). When i try to get the cookies i only get sesson id cookie. Is there any trick to get all the cookies from java in connection with google analytics? If i want to make a http post, it seems that i have to send google analytics cookies too. I can copy my code if somebody wants, but it works on other pages(for printing cookies). Thank you

    Read the article

  • Android relative layout problem with gravity

    - by DixieFlatline
    How can i put textview with id="naslov" to the center? I also tried with layout_gravity="center" but that doesn't work either. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:id="@+id/naslov" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="20dip" android:text="Povzetek" android:gravity="center"/> <TextView android:id="@+id/aha" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="10dip" android:text="Vseh oddaj:" android:layout_below="@id/naslov"/> </RelativeLayout>

    Read the article

1