[android-developers] Need Help - View Flipper Force Close Error
Hi there, for a short time now I got this Force Close Error apparently due to an error with the View Flipper. The thing is I haven't touched or changed the ViewFlipper in weeks and suddenly I got this error (see logcat output) If anyone could help me out that would be great because I have really no idea what suddenly happend... Thanks in advance. 09-02 18:04:29.923: ERROR/AndroidRuntime(5583): Uncaught handler: thread main exiting due to uncaught exception 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): java.lang.IllegalArgumentException: Receiver not registered: android.widget.viewflippe...@4476a5a0 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at android.app.ActivityThread $PackageInfo.forgetReceiverDispatcher(ActivityThread.java:673) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at android.app.ApplicationContext.unregisterReceiver(ApplicationContext.java: 757) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java: 321) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at android.widget.ViewFlipper.onDetachedFromWindow(ViewFlipper.java:104) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at android.view.View.dispatchDetachedFromWindow(View.java:5835) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1130) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1128) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1128) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1128) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1128) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1128) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at android.view.ViewRoot.dispatchDetachedFromWindow(ViewRoot.java:1603) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at android.view.ViewRoot.doDie(ViewRoot.java:2594) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at android.view.ViewRoot.die(ViewRoot.java:2564) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java: 254) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at android.view.Window$LocalWindowManager.removeViewImmediate(Window.java: 436) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java: 3693) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java: 3794) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at android.app.ActivityThread.access$2300(ActivityThread.java:126) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1936) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at android.os.Handler.dispatchMessage(Handler.java:99) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at android.os.Looper.loop(Looper.java:123) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at android.app.ActivityThread.main(ActivityThread.java:4603) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at java.lang.reflect.Method.invokeNative(Native Method) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at java.lang.reflect.Method.invoke(Method.java:521) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:860) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 09-02 18:04:29.943: ERROR/AndroidRuntime(5583): at dalvik.system.NativeStart.main(Native Method) Here is the XML for the layout: ?xml version=1.0 encoding=utf-8? RelativeLayout xmlns:android=http://schemas.android.com/apk/res/ android android:layout_width=fill_parent android:layout_height=fill_parent android:background=@drawable/shape_background_gradient LinearLayout android:layout_width=205px android:layout_height=155px android:background=#FFCC android:id=@+id/VideoViewHolder android:padding=2.5px android:layout_centerHorizontal=true android:layout_marginTop=5px android:layout_marginBottom=5px VideoView android:layout_width=200px android:layout_height=150px android:id =@+id/VideoViewEdit
[android-developers] ListView with VideoThumbs and Name
Hi there, in my application I am using the GridView as a video gallery (videos are shown as thumbs). Now I would like to add a button to the options menu, with which you can switch to a ListView. In the ListView you should be able to see (smaller) thumbs as well as the video name. But I am a little stuck and don't really know how I can show both the video thumbs and the names in the ListView. If anyone could give me a hand here, that would be really great. Cheers. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Need Help - Sliding Drawer Exception
Hi there, I just ran into a problem with my SlidingDrawer. I got a RuntimeException telling me that my SlidingDrawer cannot have UNSPECIFIED dimensions (see Catlog output). If I understand it correctly this means layout_width and layout_height are empty, but as you can see from my xml code (see further below), I have specified them. I really don't know what I should, if anyone can help me out here, that would be great. Thanks in advance. 09-01 20:02:12.209: ERROR/AndroidRuntime(2444): Uncaught handler: thread main exiting due to uncaught exception 09-01 20:02:12.229: ERROR/AndroidRuntime(2444): java.lang.RuntimeException: SlidingDrawer cannot have UNSPECIFIED dimensions 09-01 20:02:12.229: ERROR/AndroidRuntime(2444): at android.widget.SlidingDrawer.onMeasure(SlidingDrawer.java:261) 09-01 20:02:12.229: ERROR/AndroidRuntime(2444): at android.view.View.measure(View.java:7966) 09-01 20:02:12.229: ERROR/AndroidRuntime(2444): at android.widget.RelativeLayout.measureChild(RelativeLayout.java:554) 09-01 20:02:12.229: ERROR/AndroidRuntime(2444): at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:377) 09-01 20:02:12.229: ERROR/AndroidRuntime(2444): at android.view.View.measure(View.java:7966) 09-01 20:02:12.229: ERROR/AndroidRuntime(2444): at android.widget.ScrollView.measureChildWithMargins(ScrollView.java:893) 09-01 20:02:12.229: ERROR/AndroidRuntime(2444): at android.widget.FrameLayout.onMeasure(FrameLayout.java:245) 09-01 20:02:12.229: ERROR/AndroidRuntime(2444): at android.widget.ScrollView.onMeasure(ScrollView.java:276) 09-01 20:02:12.229: ERROR/AndroidRuntime(2444): at android.view.View.measure(View.java:7966) 09-01 20:02:12.229: ERROR/AndroidRuntime(2444): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3077) 09-01 20:02:12.229: ERROR/AndroidRuntime(2444): at android.widget.FrameLayout.onMeasure(FrameLayout.java:245) 09-01 20:02:12.229: ERROR/AndroidRuntime(2444): at android.view.View.measure(View.java:7966) 09-01 20:02:12.229: ERROR/AndroidRuntime(2444): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3077) 09-01 20:02:12.229: ERROR/AndroidRuntime(2444): at android.widget.FrameLayout.onMeasure(FrameLayout.java:245) 09-01 20:02:12.229: ERROR/AndroidRuntime(2444): at android.view.View.measure(View.java:7966) 09-01 20:02:12.229: ERROR/AndroidRuntime(2444): at android.view.ViewRoot.performTraversals(ViewRoot.java:783) 09-01 20:02:12.229: ERROR/AndroidRuntime(2444): at android.view.ViewRoot.handleMessage(ViewRoot.java:1666) 09-01 20:02:12.229: ERROR/AndroidRuntime(2444): at android.os.Handler.dispatchMessage(Handler.java:99) 09-01 20:02:12.229: ERROR/AndroidRuntime(2444): at android.os.Looper.loop(Looper.java:123) 09-01 20:02:12.229: ERROR/AndroidRuntime(2444): at android.app.ActivityThread.main(ActivityThread.java:4603) 09-01 20:02:12.229: ERROR/AndroidRuntime(2444): at java.lang.reflect.Method.invokeNative(Native Method) 09-01 20:02:12.229: ERROR/AndroidRuntime(2444): at java.lang.reflect.Method.invoke(Method.java:521) 09-01 20:02:12.229: ERROR/AndroidRuntime(2444): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:860) 09-01 20:02:12.229: ERROR/AndroidRuntime(2444): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 09-01 20:02:12.229: ERROR/AndroidRuntime(2444): at dalvik.system.NativeStart.main(Native Method) ?xml version=1.0 encoding=utf-8? ScrollView xmlns:android=http://schemas.android.com/apk/res/android; android:layout_width=fill_parent android:layout_height=fill_parent RelativeLayout android:layout_width=fill_parent android:layout_height=fill_parent android:background=@drawable/shape_background_gradient LinearLayout android:layout_width=205px android:layout_height=155px android:background=#FFCC android:id=@+id/VideoViewHolder android:padding=2.5px android:layout_centerHorizontal=true android:layout_marginTop=5px android:layout_marginBottom=5px VideoView android:layout_width=200px android:layout_height=150px android:id =@+id/VideoViewEdit android:layout_centerHorizontal=true /VideoView /LinearLayout TableLayout android:layout_width=fill_parent android:layout_height=fill_parent android:stretchColumns=0 android:layout_below=@id/VideoViewHolder
[android-developers] EditText doesn't show...
Hi, I am trying to set up a RelativeLayout within a SlidingDrawer that contains a ViewFlipper that amongst others chooses a view with a text entry field, but when I test the application the space for the entry field and its label appears but the field itself doesn't show. I don't know what I missing here or may have done wrong. Any help or hint in the right direction would be really great. Thanks in advance This is my layout: ?xml version=1.0 encoding=utf-8? RelativeLayout xmlns:android=http://schemas.android.com/apk/res/ android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent android:background=#9900 android:paddingLeft=2px TextView android:layout_width=fill_parent android:layout_height=wrap_content android:id=@+id/titlethemetitle android:text=@string/title_theme_title android:textColor=#99CC33 android:textSize=20sp android:textStyle=bold android:layout_marginBottom=5px /TextView TextView android:layout_width=fill_parent android:layout_height=wrap_content android:id=@+id/titlethemeintro android:text=@string/title_theme_intro android:layout_below=@id/titlethemetitle android:layout_marginBottom=10px /TextView TextView android:layout_width=wrap_content android:layout_height=wrap_content android:id=@+id/titlethemeentryholder android:layout_below=@id/titlethemeintro /TextView EditText android:id=@+id/titlethemeentry android:layout_height=wrap_content android:layout_width=fill_parent android:layout_toLeftOf=@id/titlethemeentryholder android:layout_below=@id/titlethemeintro / ScrollView android:layout_width=fill_parent android:layout_height=wrap_content android:layout_below=@id/titlethemeentry RadioGroup android:layout_width=fill_parent android:layout_height=wrap_content android:orientation=vertical android:id=@+id/radio_group_title_theme RadioButton android:checked=true android:text=@string/radio_group_title_theme_none android:id=@+id/theme_none android:textColor=#99CC33 / RadioButton android:checked=false android:text=@string/radio_group_title_theme_1 android:id=@+id/theme_1 android:textColor=#99CC33 / RadioButton android:checked=false android:text=@string/radio_group_title_theme_2 android:id=@+id/theme_2 android:textColor=#99CC33 / RadioButton android:checked=false android:text=@string/radio_group_title_theme_3 android:id=@+id/theme_3 android:textColor=#99CC33 / RadioButton android:checked=false android:text=@string/radio_group_title_theme_4 android:id=@+id/theme_4 android:textColor=#99CC33 / RadioButton android:checked=false android:text=@string/radio_group_title_theme_5 android:id=@+id/theme_5 android:textColor=#99CC33 / /RadioGroup /ScrollView /RelativeLayout Here is how I define and call the TextEntry field and its View public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.editorview); [...] txtTitleEntry = (EditText) findViewById(R.id.titlethemeentry); txtTitleEntry.setOnKeyListener(new OnKeyListener() { public boolean onKey(View v, int keyCode, KeyEvent event) { // If the event is a key-down event on the enter button if ((event.getAction() == KeyEvent.ACTION_DOWN) (keyCode == KeyEvent.KEYCODE_ENTER)) { // Perform action on key press Toast.makeText(EditorView.this, txtTitleEntry.getText(), Toast.LENGTH_SHORT).show(); return true; } return false; } }); } public void onClick(View v){ [...] else if (v == btnTitle){
[android-developers] Issue with populating a ViewFlipper child View with a ListView
Hi I am trying to populate a ViewFlipper with a ListView when a certain button is clicked...but I only get a NullPointerException for lv.setAdapter(new ArrayAdapterString(this, R.layout.specialeffectsview, specialEffects)); To be honest I don't really know how to do this, I just learned about the ViewFlipper today and I haven't fully understood how to use it yet. If anyone could help me find how what I have done wrong, that would be great. Thanks in advance. Here is the code I use: public void onClick(View v){ if (v == btnExposure){ mFlipper.setDisplayedChild(0); } else if (v == btnProperties){ mFlipper.setDisplayedChild(1); } else if (v == btnSpecialEffects){ mFlipper.setDisplayedChild(2); String[] specialEffects = getResources().getStringArray(R.array.special_effects_array); lv.setAdapter(new ArrayAdapterString(this, R.layout.specialeffectsview, specialEffects)); lv.setChoiceMode(ListView.CHOICE_MODE_SINGLE); } } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] How to recreate and reinflate a ViewStub?
Hi there, I am trying to recreate and reinflate a ViewStub each time an ImageButton is pressed because at the moment my app crashes as soon as I press the button a second time (due to a NullPointerException caused by the ViewStub that doesn't exist anymore) but I am a little stuck as I don't know how to recreate and reinvoke the ViewStub... If someone could give me a hand here, that would be great. Thanks in advance. This is what I have done so far: btnExposure = (ImageButton) findViewById(R.id.button_exposure); btnExposure.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (findViewById(R.id.stub_exposure) != null){ ViewStub stub1 = (ViewStub) findViewById(R.id.stub_exposure); importStub = stub1.inflate(); toggle(importStub2); } else { //DON'T KNOW WHAT I SHOULD DO HERE } } } ); -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] How to solve this problem: Close Force Error when trying to populate viewStub
Hi there, I just ran into a problem, while trying to populate a ViewStub by tapping an ImageButton within a SlidingDrawer (the ViewStub should also be part of the drawer), but all I get is a Force Close Error due to a Null Pointer Exception. As I am using ViewStubs for the first time I am not sure, what may have caused the exception. If someone could help me out with this issue, this would be fantastic. Thank you in advance. This is the code I use to inflate the ViewStub: btnExposure.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { importStub = ((ViewStub) findViewById(R.id.stub_exposure)).inflate(); } }); This is part of the Sliding Drawer xml file containing the ViewStub: ViewStub android:id=@+id/stub_exposure android:inflatedId=@+id/exposureview android:layout_width=fill_parent android:layout_height=fill_parent android:background=#7700 /ViewStub This is the exposureview.xml (the inflatedID): ?xml version=1.0 encoding=utf-8? RelativeLayout xmlns:android=http://schemas.android.com/apk/res/ android android:layout_width=fill_parent android:layout_height=fill_parent SeekBar android:layout_width=wrap_content android:layout_height=wrap_content android:thumb=@drawable/seek_thumb android:progress=50 android:max=100 /SeekBar /RelativeLayout -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] VideoView and SlidingDrawer problem
Hi there, I have a bit of a problem with a SlidingDrawer that I created and that should go over my VideoView. When the activity is opened for the first time you can see the slider above the video and when you tap it, it slides open. However, as soon as you close the slider it seems to disappear underneath the VideoView and is not visible anymore. It is still there and when you tap the location where the handle is located the slidingDrawer reappears, but I would rather prefer if it wasn't hiding all the time ;) If anyone knows what I can do about that and help me out, that would be really fantastic because I have been trying for hours now and I have no idea what I should do. I also haven't found a similar issue or a solution for that. Thank you in advance. This here is the xml code for the videoview and the slidingDrawer: ?xml version=1.0 encoding=utf-8? RelativeLayout xmlns:android=http://schemas.android.com/apk/res/ android android:layout_width=fill_parent android:layout_height=fill_parent android:background=@drawable/shape_background_gradient VideoView android:layout_width=240px android:layout_height=180px android:id =@+id/VideoViewEdit android:layout_centerHorizontal=true /VideoView ScrollView android:layout_width=fill_parent android:layout_height=wrap_content android:layout_below=@id/VideoViewEdit TableLayout android:layout_width=fill_parent android:layout_height=fill_parent android:stretchColumns=0 TableRow android:background=@drawable/shape_track_background android:padding=5px ImageView android:layout_width=wrap_content android:layout_height=wrap_content android:src=@drawable/ic_editor_videotrack android:padding=5px android:layout_gravity=left/ /TableRow TableRow android:background=@drawable/shape_track_background android:padding=5px ImageView android:layout_width=wrap_content android:layout_height=wrap_content android:src=@drawable/ic_editor_audiotrack android:padding=5px android:layout_gravity=left/ /TableRow TableRow android:background=@drawable/shape_track_background android:padding=5px ImageButton android:layout_width=wrap_content android:layout_height=wrap_content android:src=@drawable/ic_editor_add_media android:padding=5px android:layout_gravity=left / /TableRow /TableLayout /ScrollView SlidingDrawer android:id=@+id/drawer android:layout_width=wrap_content android:layout_height=wrap_content android:orientation=horizontal android:handle=@+id/handle android:content=@+id/content ImageView android:id=@id/handle android:layout_width=wrap_content android:layout_height=wrap_content android:src=@drawable/slider_handle / LinearLayout android:id=@id/content android:layout_width=fill_parent android:layout_height=fill_parent android:orientation=vertical ImageButton
[android-developers] What to do when - java.io.FileNotFoundException: No content provider??
Hi everyone, when I try to attach a file to an email, I get a java.io.FileNotFoundException: No content provider logcat output. If anyone could tell me what I am doing wrong or what I should do instead, that would be great.Thank you. This is how I add the files to the email..: Intent sendIntent = new Intent(Intent.ACTION_SEND); sendIntent.putExtra(Intent.EXTRA_STREAM, uri); sendIntent.setType(video/3gp); sendIntent.setType(video/mp4); startActivity(sendIntent); ...and here is the entire logcat error output: 20 09:15:58.364: ERROR/Mms/media(168): IOException caught while opening or reading stream 07-20 09:15:58.364: ERROR/Mms/media(168): java.io.FileNotFoundException: No content provider: /sdcard/ Video0006.mp4 07-20 09:15:58.364: ERROR/Mms/media(168): at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java: 507) 07-20 09:15:58.364: ERROR/Mms/media(168): at android.content.ContentResolver.openInputStream(ContentResolver.java: 345) 07-20 09:15:58.364: ERROR/Mms/media(168): at com.android.mms.model.MediaModel.initMediaSize(MediaModel.java:268) 07-20 09:15:58.364: ERROR/Mms/media(168): at com.android.mms.model.MediaModel.init(MediaModel.java:76) 07-20 09:15:58.364: ERROR/Mms/media(168): at com.android.mms.model.RegionMediaModel.init(RegionMediaModel.java: 40) 07-20 09:15:58.364: ERROR/Mms/media(168): at com.android.mms.model.VideoModel.init(VideoModel.java:55) 07-20 09:15:58.364: ERROR/Mms/media(168): at com.android.mms.model.VideoModel.init(VideoModel.java:48) 07-20 09:15:58.364: ERROR/Mms/media(168): at com.android.mms.data.WorkingMessage.changeMedia(WorkingMessage.java: 434) 07-20 09:15:58.364: ERROR/Mms/media(168): at com.android.mms.data.WorkingMessage.setAttachment(WorkingMessage.java: 343) 07-20 09:15:58.364: ERROR/Mms/media(168): at com.android.mms.ui.ComposeMessageActivity.addVideo(ComposeMessageActivity.java: 2472) 07-20 09:15:58.364: ERROR/Mms/media(168): at com.android.mms.ui.ComposeMessageActivity.addAttachment(ComposeMessageActivity.java: 2544) 07-20 09:15:58.364: ERROR/Mms/media(168): at com.android.mms.ui.ComposeMessageActivity.handleSendIntent(ComposeMessageActivity.java: 2521) 07-20 09:15:58.364: ERROR/Mms/media(168): at com.android.mms.ui.ComposeMessageActivity.initialize(ComposeMessageActivity.java: 1703) 07-20 09:15:58.364: ERROR/Mms/media(168): at com.android.mms.ui.ComposeMessageActivity.onCreate(ComposeMessageActivity.java: 1633) 07-20 09:15:58.364: ERROR/Mms/media(168): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java: 1047) 07-20 09:15:58.364: ERROR/Mms/media(168): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 2459) 07-20 09:15:58.364: ERROR/Mms/media(168): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java: 2512) 07-20 09:15:58.364: ERROR/Mms/media(168): at android.app.ActivityThread.access$2200(ActivityThread.java:119) 07-20 09:15:58.364: ERROR/Mms/media(168): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863) 07-20 09:15:58.364: ERROR/Mms/media(168): at android.os.Handler.dispatchMessage(Handler.java:99) 07-20 09:15:58.364: ERROR/Mms/media(168): at android.os.Looper.loop(Looper.java:123) 07-20 09:15:58.364: ERROR/Mms/media(168): at android.app.ActivityThread.main(ActivityThread.java:4363) 07-20 09:15:58.364: ERROR/Mms/media(168): at java.lang.reflect.Method.invokeNative(Native Method) 07-20 09:15:58.364: ERROR/Mms/media(168): at java.lang.reflect.Method.invoke(Method.java:521) 07-20 09:15:58.364: ERROR/Mms/media(168): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:860) 07-20 09:15:58.364: ERROR/Mms/media(168): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 07-20 09:15:58.364: ERROR/Mms/media(168): at dalvik.system.NativeStart.main(Native Method) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] How to call a clicked item within an intent??
Hi, in my code I am trying to call the last clicked item within an intent. Inside an onClick event, the Uri gets tagged to keep track of the item that was clicked, but I don't know how I can call this uri now from within the intent. What I mean is: here I tag the item... vGrid.setOnItemClickListener(new OnItemClickListener() { @Override // click on item and open options menu public void onItemClick(AdapterView? parent, View v, int position, long id) { //get uri of selected/clicked video String uri = (String) v.getTag(); String [] proj={MediaStore.Video.Media.DATA}; videocursor = managedQuery( MediaStore.Video.Media.EXTERNAL_CONTENT_URI, proj, null,null,null); videocursor.moveToPosition((int) vGrid.getSelectedItemId()); // print the filename Toast.makeText(ShareGalleryView.this, You just selected +uri, Toast.LENGTH_SHORT).show(); openOptionsMenu(); //Opens Options Menu by clicking a video } }); and inside an menu I would like to call the item that was clicked and attach it to the new intent: i.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File())); //HOW TO CALL THE CLICKED ITEM?? @Override //creates options menu with menu-items public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu_gallery_share, menu); return super.onCreateOptionsMenu(menu); } @Override //what happens when a menu item is clicked public boolean onOptionsItemSelected (MenuItem item){ try{ //Facebook if (item.getItemId() == R.id.menu_facebook) { //TODO open fb new AlertDialog.Builder(this) .setTitle(No Service) .setMessage(Sorry, Facebook is not supported yet!) .setNeutralButton(Close, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub }}).show(); return true; } //YouTube else if (item.getItemId() == R.id.menu_youtube) { //TODO open YouTube new AlertDialog.Builder(this) .setTitle(No Service) .setMessage(Sorry, YouTube is not supported yet!) .setNeutralButton(Close, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub }}).show(); return true; } else if (item.getItemId() == R.id.menu_email) { Intent i = new Intent(Intent.ACTION_SEND); i.setType(text/plain); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.setType(video/mp4); i.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File())); //HOW TO CALL THE CLICKED ITEM?? startActivity(i); return true; } else if (item.getItemId() == R.id.menu_bluetooth) { // TODO send via bluetooth new AlertDialog.Builder(this) .setTitle(No Service) .setMessage(Sorry, Bluetooth is not supported yet!) .setNeutralButton(Close, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub }}).show(); return true; } } catch(Exception e) { e.printStackTrace(); } return super.onContextItemSelected(item); } Any help is welcome, I would really appreciate if someone could give me a hand here. Thank you. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] How to attach a video to an email...???
Hi everyone, I am working on a Video App, where you can click on a video from the sdcard. This click event opens a menu (I used a options menu) that provides the user with different sharing options, e.g. email, bluetooth etc. This part works fine so far... What I am now trying to do is, when the user chooses email the app should open the email app of the phone via an intent (this also works fine) and should directly attach the video he clicked before to the new email . The last part is, where I am stuck because I don't know how to tell the app that the video that was clicked before to open the menu should be attached to the mail: Intent i = new Intent(Intent.ACTION_SEND); i.setType(text/plain); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.setType(video/mp4); i.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(Environment.getExternalStorageDirectory(),DON'T KNOW HOW TO ACCESS THE CLICKE FILENAME))); startActivity(i); I would appreciate any advice or help. Thank you in advance ...I will post my entire code below... package com.mobilevideoeditor.moved; import java.io.File; import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.provider.MediaStore; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.BaseAdapter; import android.widget.GridView; import android.widget.TextView; import android.widget.AdapterView.OnItemClickListener; public class ShareGalleryView extends Activity { private Cursor videocursor; private int video_column_index; int count; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.videogrid); //create new Grid View GridView vGrid=(GridView) findViewById(R.id.vgrid); registerForContextMenu(vGrid); vGrid.setAdapter(new VideoAdapter(this)); init_phone_video_grid(); vGrid.setOnItemClickListener(new OnItemClickListener() { @Override // click on item and open options menu public void onItemClick(AdapterView? parent, View v, int position, long id) { openOptionsMenu(); //Opens Options Menu by clicking on an item } }); } private void init_phone_video_grid() { System.gc(); String[] proj = { MediaStore.Video.Media._ID, MediaStore.Video.Media.DISPLAY_NAME, MediaStore.Video.Media.DATA }; videocursor = managedQuery(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, proj, null, null, null); count = videocursor.getCount(); GridView vGrid=(GridView) findViewById(R.id.vgrid); vGrid.setAdapter(new VideoAdapter(this)); } @Override //creates options menu with menu-items public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu_gallery_share, menu); return super.onCreateOptionsMenu(menu); } @Override //what happens when a menu item is clicked public boolean onOptionsItemSelected (MenuItem item){ try{ //Facebook if (item.getItemId() == R.id.menu_facebook) { //TODO open fb new AlertDialog.Builder(this) .setTitle(No Service) .setMessage(Sorry, Facebook is not supported yet!) .setNeutralButton(Close, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub }}).show(); return true; } //YouTube else if (item.getItemId() == R.id.menu_youtube) { //TODO open YouTube new AlertDialog.Builder(this) .setTitle(No Service) .setMessage(Sorry, YouTube is not supported yet!) .setNeutralButton(Close, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub }}).show();
[android-developers] Don't know how to show Video Thumbnails
Hi, I have been trying to display thumbnails of videos that I have stored on the SD card of the emulator. On stackflow someone posted the following code to a similar question of somebody else: int id = **The Video's ID** ImageView iv = (ImageView ) convertView.findViewById(R.id.imagePreview); ContentResolver crThumb = getContentResolver(); BitmapFactory.Options options=new BitmapFactory.Options(); options.inSampleSize = 1; Bitmap curThumb = MediaStore.Video.Thumbnails.getThumbnail(crThumb, id, MediaStore.Video.Thumbnails.MICRO_KIND, options); iv.setImageBitmap(curThumb); And I also read about MediaStore.Video.Thumbnails on the android dev site...but I have to say, that I don't fully understand it yet and I just have no idea, if, how and where I could use that in my code. And everything I tried didn't... I am really getting a bit desperate at the moment. If someone could help me by explaining or showing me what I should do, I would be really grateful. This is the code I have so far... package com.mobilevideoeditor.moved; import android.app.Activity; import android.content.Context; import android.database.Cursor; import android.os.Bundle; import android.provider.MediaStore; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.GridView; import android.widget.TextView; public class EditGalleryView extends Activity { private Cursor videocursor; //private int video_column_index; private static int displayNameIndex = -1; int count; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.videogrid); init_phone_video_grid(); } private void init_phone_video_grid() { System.gc(); String[] proj = { MediaStore.Video.Media._ID, MediaStore.Video.Media.DISPLAY_NAME, MediaStore.Video.Media.DATA }; videocursor = managedQuery(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, proj, null, null, null); count = videocursor.getCount(); GridView vGrid=(GridView) findViewById(R.id.vgrid); vGrid.setAdapter(new VideoAdapter(this)); } public class VideoAdapter extends BaseAdapter { private Context vContext; public VideoAdapter(Context c) { vContext = c; } public int getCount() { return count; } public Object getItem(int position) { return null; } public long getItemId(int position) { return 0; } public View getView(int position, View convertView, ViewGroup parent) { TextView tv; String id; if (convertView == null) { // Need to create a new view tv = new TextView(vContext); } else { // Otherwise, we can recycle the one given to us tv = (TextView) convertView; } // Cache column index (or just hardcode it) if (displayNameIndex == -1) { displayNameIndex = videocursor.getColumnIndexOrThrow(MediaStore.Video.Media.DISPLAY_NAME); } // Bind cursor data to UI videocursor.moveToPosition(position); id = videocursor.getString(displayNameIndex); tv.setText(id); // Bundle video URI into the view String videoUri = videocursor.getString(2); // column index of Media.DATA tv.setTag(videoUri); return tv; } } } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Need help - videos won't show as thumbs
Hi there, I am trying to display videos form the emulated sdcard, but it seems that I have done something wrong because no video thumbs are displayed within my gridview... it would be great if someone could help me out, because I have no idea at the moment what I may have done wrong... Thank you in advance... Here is my code of the java file... package com.mobilevideoeditor.moved; import java.util.ArrayList; import android.app.Activity; import android.content.Context; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.provider.MediaStore; import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.GridView; import android.widget.VideoView; public class EditGalleryView extends Activity { Uri[] vidUris; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.videogrid); GridView vGrid=(GridView) findViewById(R.id.vgrid); vGrid.setAdapter(new VideoAdapter(this)); Uri uri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI; Log.d(EditGalleryView, uri:+uri); String[] projection = { MediaStore.Video.Media.DESCRIPTION, MediaStore.Video.Media.DATA }; Cursor c = this.managedQuery(uri, projection, null, null, MediaStore.Video.Media.DATE_ADDED); Log.d(EditGalleryView, vids available: +c.getCount()); ArrayListUri experimentVids = new ArrayListUri(); if (c.getCount() != 0) { c.moveToFirst(); experimentVids.add(Uri.parse(c.getString(1))); while (c.moveToNext()) { experimentVids.add(Uri.parse(c.getString(1))); } } Log.d(ClassName, experimentVids.length: +experimentVids.size()); if (experimentVids.size() != 0) { vidUris = new Uri[experimentVids.size()]; for (int i = 0; i experimentVids.size(); i++) { vidUris[i] = experimentVids.get(i); } Log.d(EditGalleryView, vidUris:+vidUris.length); } } public class VideoAdapter extends BaseAdapter { private Context mContext; public VideoAdapter(Context c) { mContext = c; } public int getCount() { //return mThumbIds.length; if(vidUris!=null){ return vidUris.length;} return 0; } public Object getItem(int position) { //return null; return position; } public long getItemId(int position) { //return 0; return position; } // create a new ImageView for each item referenced by the Adapter public View getView(int position, View convertView, ViewGroup parent) { VideoView videoView; if (convertView == null) { // if it's not recycled, initialize some attributes videoView = new VideoView(mContext); videoView.setVideoURI(vidUris[position]); videoView.setLayoutParams(new GridView.LayoutParams(85, 85)); //videoView.setScaleType(VideoView.ScaleType.CENTER_CROP); videoView.setPadding(8, 8, 8, 8); } else { videoView = (VideoView) convertView; } // imageView.setImageResource(mThumbIds[position]); return videoView; } /* // references to our images private Integer[] mThumbIds = { R.drawable.sample_2, R.drawable.sample_3, R.drawable.sample_4, R.drawable.sample_2, R.drawable.sample_6, R.drawable.sample_3, R.drawable.sample_4, R.drawable.sample_1, };*/ } } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at
[android-developers] If and How to get video thumbnails?
Hi, I am working on a video app. And I have created a GridView that shall display any video stored on the sdcard. Currently it only displays the name of the video file. I wanted to ask if and how it would be possible instead of showing only the name to also display thumbs (or a frame preview) of the videos ?!? I would be grateful for any help...thanks. I wanted to ask if and how it would be possible instead of showing only the name to also display thumbs (or a frame preview) of the videos ?!? I would be grateful for any help...thanks. This is the code I have used so far: package com.mobilevideoeditor.moved; import android.app.Activity; import android.content.Context; import android.database.Cursor; import android.os.Bundle; import android.provider.MediaStore; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.GridView; import android.widget.TextView; public class EditGalleryView extends Activity { private Cursor videocursor; private int video_column_index; int count; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.videogrid); init_phone_video_grid(); } private void init_phone_video_grid() { System.gc(); String[] proj = { MediaStore.Video.Media._ID, MediaStore.Video.Media.DISPLAY_NAME, MediaStore.Video.Media.DATA }; videocursor = managedQuery(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, proj, null, null, null); count = videocursor.getCount(); GridView vGrid=(GridView) findViewById(R.id.vgrid); vGrid.setAdapter(new VideoAdapter(this)); } public class VideoAdapter extends BaseAdapter { private Context vContext; public VideoAdapter(Context c) { vContext = c; } public int getCount() { //return mThumbIds.length; return count; } public Object getItem(int position) { //return null; return position; } public long getItemId(int position) { //return 0; return position; } // create a new ImageView for each item referenced by the Adapter public View getView(int position, View convertView, ViewGroup parent) { System.gc(); TextView tv = new TextView(vContext.getApplicationContext()); String id = null; if (convertView == null) { video_column_index = videocursor.getColumnIndexOrThrow(MediaStore.Video.Media.DISPLAY_NAME); videocursor.moveToPosition(position); id = videocursor.getString(video_column_index); tv.setText(id); } else tv = (TextView) convertView; return tv; } } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] video gallery within tab view
Hi there, I am desperately looking for a way to load and access videos from the phone's and SD card's gallery/directory into a tab view that I created and arrange video thumbs in a view similar to the grid view. Is this even possible and how could I get started? It would be really great if someone could help me with that...Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Stuck with video gallery access...
Hi there, I have a problem and I could really need some help. Is it possible and if so how could I access the video gallery/ directory on a phone and its SD card and display the videos as thumbs in some sort of grid view like arrangement within a Tab view that I have created. And also what I would like to have is when you select a video thumb, the video shouldn't start playing but a menu should open for some options the user can choose from. Thank you in advance. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en