Search Results

Search found 3 results on 1 pages for 'nadi'.

Page 1/1 | 1 

  • Show MapView on PopupWindow

    - by Ali Nadi
    I want to show MapView on PopupWindow and get error when press-on Map. Please help! Liste.java MapView mapView; View view; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.liste); LayoutInflater mInflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE); view = mInflater.inflate(R.layout.pop_up, (ViewGroup) findViewById(R.id.popup_element), false); mapView = (MapView) view.findViewById(R.id.mapview_popup); listView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View v, int position, long id) { initiatePopupWindow(earthQuakeList.get(position)); } }); } private void initiatePopupWindow(EqData data) { try { mapView.setBuiltInZoomControls(true); List<Overlay> mapOverlays = mapView.getOverlays(); Drawable marker = this.getResources().getDrawable(R.drawable.marker1); HaritaOverlay itemizedoverlay = new HaritaOverlay(marker, this); Coordination coord = data.getCoordination(); GeoPoint point = new GeoPoint( (int)coord.latitude, (int)coord.longitude); OverlayItem overlayitem = new OverlayItem(point, data.lokasyon, data.name); itemizedoverlay.addOverlay(overlayitem); mapOverlays.add(itemizedoverlay); Display display = getWindowManager().getDefaultDisplay(); pw = new PopupWindow(view, display.getWidth(), display.getHeight()/2, true); // display the popup in the center pw.showAtLocation(view, Gravity.CENTER, 0, display.getHeight()/2); } catch (Exception e) { e.printStackTrace(); } } pop_up.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:baselineAligned="false" android:orientation="vertical" android:weightSum="540" android:id="@+id/popup_element" > ... <LinearLayout android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="440" > <com.google.android.maps.MapView android:id="@+id/mapview_popup" android:layout_width="fill_parent" android:layout_height="fill_parent" android:apiKey="@string/ApiMapKey" android:clickable="true" /> </LinearLayout> Error 07-23 17:36:28.820: E/MapActivity(12413): Couldn't get connection factory client 07-23 17:36:37.760: E/AndroidRuntime(12413): FATAL EXCEPTION: main 07-23 17:36:37.760: E/AndroidRuntime(12413): android.view.WindowManager$BadTokenException: Unable to add window -- token android.view.ViewRoot$W@40590b70 is not valid; is your activity running? 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.ViewRoot.setView(ViewRoot.java:528) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.Window$LocalWindowManager.addView(Window.java:465) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.widget.ZoomButtonsController.setVisible(ZoomButtonsController.java:370) 07-23 17:36:37.760: E/AndroidRuntime(12413): at com.google.android.maps.MapView.displayZoomControls(MapView.java:1053) 07-23 17:36:37.760: E/AndroidRuntime(12413): at com.google.android.maps.MapView$1.onDown(MapView.java:341) 07-23 17:36:37.760: E/AndroidRuntime(12413): at com.google.android.maps.GestureDetector.onTouchEvent(GestureDetector.java:488) 07-23 17:36:37.760: E/AndroidRuntime(12413): at com.google.android.maps.MapView.onTouchEvent(MapView.java:683) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.View.dispatchTouchEvent(View.java:3901) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2200) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.ViewRoot.handleMessage(ViewRoot.java:1884) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.os.Handler.dispatchMessage(Handler.java:99) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.os.Looper.loop(Looper.java:130) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.app.ActivityThread.main(ActivityThread.java:3835) 07-23 17:36:37.760: E/AndroidRuntime(12413): at java.lang.reflect.Method.invokeNative(Native Method) 07-23 17:36:37.760: E/AndroidRuntime(12413): at java.lang.reflect.Method.invoke(Method.java:507) 07-23 17:36:37.760: E/AndroidRuntime(12413): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847) 07-23 17:36:37.760: E/AndroidRuntime(12413): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605) 07-23 17:36:37.760: E/AndroidRuntime(12413): at dalvik.system.NativeStart.main(Native Method)

    Read the article

  • sum of logarithams of prime numbers

    - by nadi
    Write a program that computes the sum of the logarithms of all the primes from 2 to some number n, and print out the sum of the logs of the primes, the number n, and the ratio of these two quantities. Test this for different values of n.

    Read the article

  • Laravel 4 showing all field from one to one relationship in

    - by rivai04
    I'm trying to show all field of the chosen row from one to one relationship... Route Route::get('relasi-pasien', function() { $pasien = PasienIri::where('no_ipd', '=', '100')->first(); foreach($pasien->keadaanumum as $temp) { echo'<li> Name : '.$temp->name. 'Tekdar: '.$temp->tekdar. 'Nadi : '.$temp->nadi. '</li>'; } }); Relation at PasienIri's model public function keadaanumum() { return $this->hasOne('KeadaanUmum', 'no_ipd'); } Relation at KeadaanUmum's Model public function pasieniri() { return $this->belongsTo('PasienIri', 'no_ipd'); } When I used that way, it showed error: 'Trying to get property of non-object' But if I just trying to show only one of the field, it works, showing one field: Route::get('relasi-pasien', function() { $pasien = PasienIri::where('no_ipd', '=', '100')->first(); return $pasien->keadaanumum->name; }); anyone could help me to show all field with one to one relationship or I really have to change it to one to many relationship? cause if I change it to one to many relationship, it works

    Read the article

1