[android-developers] how to depress the onLongClick() when drag a view
Hi, I have a View and I can drag it. It also has a onLongClick() method so it can respond to the long press on the screen. The problem is when I drag it , the onLongClick will also be triggered . Anyone have an idea to depress the long click detection when i move it . Thanks in advances. Shawn. -- 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
Re: [android-developers] Re: how to depress the onLongClick() when drag a view
thx for your reply but it doesn't work as will. setLongClickable() in case MotionEvent.ACTION_MOVE phrase doesn't work. But I have figure out the way. The view default implementation will cancel the long press check on ACTION_MOVE,so I just call the super.onTouchEvent to let the default implementation takes effect. 2010/4/19 grace grace.a...@wipro.com hi, try disabling the longClick event using public void setLongClickable (boolean longClickable) function while ur performing the drag operation and enable it after that.. so that u can have both the functionalities.. Regards, Grace. On Apr 19, 11:47 am, sheng wang banxia...@gmail.com wrote: Hi, I have a View and I can drag it. It also has a onLongClick() method so it can respond to the long press on the screen. The problem is when I drag it , the onLongClick will also be triggered . Anyone have an idea to depress the long click detection when i move it . Thanks in advances. Shawn. -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group athttp:// groups.google.com/group/android-developers?hl=en -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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] HistoryRecord - Activity instance
Hi This may sounds weird. I have a HistoryRecord variable, which stand for an activiy (I think). How to get the real activity instance from it ? Regards, Shawn. -- 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 get the bitmap data before it is drawn on the screen
Hi there, To any normal android Widgets based on View( Button ,TextView ...), I wanna manipulate the bitmap data before it is drawn on screen. I have tried the onDraw(Canvas canvas) method, But when the programe hit the onDraw(Canvas canvas) method, I think the bitmap has already been drawn to screen. If there is any way that I can get the bitmap data before it's drawn to screen, so I can prevent it from being displayed , but grab the data, put it on the intent for some further use? Any help will be appreciated. Shawn. -- 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] Re: how to get the bitmap data before it is drawn on the screen
View.getDrawingCache() can get the bitmap data, but it will also displayed on screen. I haven't figure out how to get the bitmap as while as prevent it from showing on the screen simultaneously. 2010/2/23 sheng wang banxia...@gmail.com Hi there, To any normal android Widgets based on View( Button ,TextView ...), I wanna manipulate the bitmap data before it is drawn on screen. I have tried the onDraw(Canvas canvas) method, But when the programe hit the onDraw(Canvas canvas) method, I think the bitmap has already been drawn to screen. If there is any way that I can get the bitmap data before it's drawn to screen, so I can prevent it from being displayed , but grab the data, put it on the intent for some further use? Any help will be appreciated. Shawn. -- 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] relation between ViewRoot and View
Hi , Can any one give more information about ViewRoot and what's the relation between viewroot and view? I found a Viewroot create a surface at its' constructor, which I think is the real bitmap data goes to. So I guess every view has it own viewroot, every view has a surface for drawing and the surfaceflinger will finally blend all surfaces together, but I found it's definitely wrong. How view and viewroot cooperate is quite ambiguous to me. Any information will be appreciated! -- 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
Re: [android-developers] Re: How to send motion Event down to another activity
Hi GuoBin, 1. My translucent activity will be the root acitivity, and very possible the home screen will be just behind, but what is the programmable way that can get a activity variable equals to the Home Launcher ? 2010/2/8 Guobin zzg...@gmail.com 1. Possibly there are ways to find the activity behind the current one. Precondition: All activity are fullscreen. If your activity is the root activity, then Home is in behind. Otherwise find the previous activity in the task stack. 1. My translucent activity will be the root acitivity, and very possible the home screen will be just behind, but what is the programmable way that can get a activity variable equals to the Home Launcher in my activity? 2. You could send the touch event to other activity, but it's useless I think. The Android Window Mananger can only handle UI events for one view hirarchy at one time. May you send the event to the other activity, but no one can handle it. 2. In my understanding the activity behind in OnResume status, but it's still running. I'm really not sure about that I will try some test on it . BRs Guobin On Feb 8, 12:50 pm, sheng wang banxia...@gmail.com wrote: Hi GuoBin, I understand what u mean below. I think that's the standard way the android deal with the event. Event goes through a current path within the activity. No event will go out of the current activity. As a surround way, is there any method that can let the current activity find out who is behind him? so he might communicate with the one behind it? Anyway, think you for taking your time to think the question. Shawn. 2010/2/8 Guobin zzg...@gmail.com 1. Whether the event can be send down to any thing behind the current activity. No, you can't. On the Android platform, you define an Activity's UI using a hierarchy of View and ViewGroup nodes. Home your activity are different activity, they have their own view hierarchy. Key events are always delivered to the View currently in focus. They are dispatched starting from the top of the View hierarchy, and then down, until they reach the appropriate destination. But not the view of other activity. http://developer.android.com/guide/topics/ui/ui-events.html Guobin -- 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.comandroid-developers%2bunsubscr...@googlegroups.com android-developers%2bunsubscr...@googlegroups.comandroid-developers%252bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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
Re: [android-developers] Re: How to send motion Event down to another activity
Hi About the make your window not fullscreen. The activity starts full screen. I remember some theme can make the activity not fullscreen. But it's not so flexible, the floating window will be centered on the screen and can not be moved(correct me if I'm wrong) Besides the theme, are there any other way to make a activity not fullscreen ? 2010/2/9 Dianne Hackborn hack...@android.com Hi, You can't get the activity behind unless it is your own. Otherwise it is in another process and untouchable by you. There is only ever one activity resumed at a time, so if you are in the front and resumed, then the home screen (or whatever) behind you is paused (though not stopped because it is still visible). The only way to let events get to the window behind yours is to make your window not fullscreen, and set WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL to tell the window manager that touches outside of your window should be delivered to whatever is behind it. On Mon, Feb 8, 2010 at 7:17 PM, sheng wang banxia...@gmail.com wrote: Hi GuoBin, 1. My translucent activity will be the root acitivity, and very possible the home screen will be just behind, but what is the programmable way that can get a activity variable equals to the Home Launcher ? 2010/2/8 Guobin zzg...@gmail.com 1. Possibly there are ways to find the activity behind the current one. Precondition: All activity are fullscreen. If your activity is the root activity, then Home is in behind. Otherwise find the previous activity in the task stack. 1. My translucent activity will be the root acitivity, and very possible the home screen will be just behind, but what is the programmable way that can get a activity variable equals to the Home Launcher in my activity? 2. You could send the touch event to other activity, but it's useless I think. The Android Window Mananger can only handle UI events for one view hirarchy at one time. May you send the event to the other activity, but no one can handle it. 2. In my understanding the activity behind in OnResume status, but it's still running. I'm really not sure about that I will try some test on it . BRs Guobin On Feb 8, 12:50 pm, sheng wang banxia...@gmail.com wrote: Hi GuoBin, I understand what u mean below. I think that's the standard way the android deal with the event. Event goes through a current path within the activity. No event will go out of the current activity. As a surround way, is there any method that can let the current activity find out who is behind him? so he might communicate with the one behind it? Anyway, think you for taking your time to think the question. Shawn. 2010/2/8 Guobin zzg...@gmail.com 1. Whether the event can be send down to any thing behind the current activity. No, you can't. On the Android platform, you define an Activity's UI using a hierarchy of View and ViewGroup nodes. Home your activity are different activity, they have their own view hierarchy. Key events are always delivered to the View currently in focus. They are dispatched starting from the top of the View hierarchy, and then down, until they reach the appropriate destination. But not the view of other activity. http://developer.android.com/guide/topics/ui/ui-events.html Guobin -- 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.comandroid-developers%2bunsubscr...@googlegroups.com android-developers%2bunsubscr...@googlegroups.comandroid-developers%252bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All
[android-developers] How to send motion Event down to another activity
Hi, My Activity using transparent Theme in AndroidManifest.xml *android:theme=@android:style/Theme.Translucent* * * Which works fine. When it's started from the Home screen, we can see both the content of my activity and the home screen below it. It gives the feeling of floating . Furthermore, to make it real floating, the motionEvent has to go down to the home screen to let the home screen response some motion touch. But I have no idea of 2 things : 1. Whether the event can be send down to any thing behind the current activity. 2. If so, how. The solution don't need to be restricted in API level. I mean if any solution need us to rewrite home screen or something else, It's also ok for me. Thanks for any suggestion. Shawn. -- 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
Re: [android-developers] Re: How to send motion Event down to another activity
Hi GuoBin, I understand what u mean below. I think that's the standard way the android deal with the event. Event goes through a current path within the activity. No event will go out of the current activity. As a surround way, is there any method that can let the current activity find out who is behind him? so he might communicate with the one behind it? Anyway, think you for taking your time to think the question. Shawn. 2010/2/8 Guobin zzg...@gmail.com 1. Whether the event can be send down to any thing behind the current activity. No, you can't. On the Android platform, you define an Activity's UI using a hierarchy of View and ViewGroup nodes. Home your activity are different activity, they have their own view hierarchy. Key events are always delivered to the View currently in focus. They are dispatched starting from the top of the View hierarchy, and then down, until they reach the appropriate destination. But not the view of other activity. http://developer.android.com/guide/topics/ui/ui-events.html Guobin -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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
Re: [android-developers] Re: How to get old version of android source
That's exactly what I need. Thx. 2010/2/4 abukustfan abukust...@gmail.com Hi, Did you try below? $ repo init -u git://android.git.kernel.org/platform/manifest.git -b android-1.6_r2 On Feb 4, 10:48 am, sheng wang banxia...@gmail.com wrote: Hi, According to the doc of http://source.android.com/download *If you would like to check out a branch other than master, specify it with -b, like:* *$ repo init** -u git://android.git.kernel.org/platform/manifest.git -b cupcake* I need to download android source 1.6 which match the android sdk 1.6, I guess the command should looks similar like above. Anyone can tell me what exactly it should be ? Thanks in advances. Shawn. -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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 get old version of android source
Hi, According to the doc of http://source.android.com/download *If you would like to check out a branch other than master, specify it with -b, like:* *$ repo init** -u git://android.git.kernel.org/platform/manifest.git -b cupcake* I need to download android source 1.6 which match the android sdk 1.6, I guess the command should looks similar like above. Anyone can tell me what exactly it should be ? Thanks in advances. Shawn. -- 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 add a new method in framework
Hi all, For some reason I need to add a new public method in Canvas.java just as bellow: /** * */ public Bitmap getBitmap() { if (mBitmap != null) { return mBitmap; } else { return null; } } After that I make update-api, then make successfully. the problem is when I develop in eclipse, the eclipse won't recognize the new getBitmap method and won't get apk build. Is there anything else I should do to let eclipse work with the new method? Thx in advanc. Shawn -- 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
Re: [android-developers] how to add a new method in framework
Hi Romain, thanks for ur replay. I totally agree with you that the @hide will be the better way. But I don't think the @hide really solve my question. I guess I don't make it quite clear. The scenario is : 1. I have my eclipse and sdk installed on my PC (windows xp) 2. The android source tree stays in vmware (Ubuntu), the make also happens here. The question block me is: After I add some new method in framework, the process of make is fine. After that , I copy all 3 img file in mydroid/out/target/product/generic from Ubuntu to my windows SDK directory , overwrite the exists files. When I coding in eclipse, the IDE seems have no idea of the new method that I have add. The new added method will be treated as syntax error. So no apk will be created. I guess there are something more that I should do to let my eclipse recognize my new method. Give me a hand~ 2010/1/25 Romain Guy romain...@android.com Do not add new public APIs this way. This is fine if you want to contribute changes to the Android Open Source Project (and if they are accepted of course) but if it's for your own version of the platform, you should just make the method public and use the @hide javadoc tag so that you don't need make update-api. On Mon, Jan 25, 2010 at 12:13 AM, sheng wang banxia...@gmail.com wrote: Hi all, For some reason I need to add a new public method in Canvas.java just as bellow: /** * */ public Bitmap getBitmap() { if (mBitmap != null) { return mBitmap; } else { return null; } } After that I make update-api, then make successfully. the problem is when I develop in eclipse, the eclipse won't recognize the new getBitmap method and won't get apk build. Is there anything else I should do to let eclipse work with the new method? Thx in advanc. Shawn -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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 add log in android C code?
Hi All, I want to debug android source code in C (WebView part) . Can I debug the android source code in C with the help of ADB? Or how can I use log in C code just the Log.v in Java? Please help me out. Thanks in advance, Shawn. -- 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
Re: [android-developers] Write a file to sdcard...
confirm one more thing: The sdcard image has been setup when you create the AVD 2009/12/15 Mark Wyszomierski mar...@gmail.com Hi, I'm trying to create a file on the sd card. Using this: OutputStream out = new FileOutputStream(/sdcard/tmp.jpg); but that throws a FileNotFoundException. Isn't OutputStream supposed to create the file, if not found on disk? I'm looking to write image data there. This is on a 1.6 emulator. I have an SD card installed, I'm looking at the sdcard folder through DDMS, so it's there. 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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 send a motionEvent through a transparent activity
Hi All, I made an activity with the transparent theme. When it starts up, the background home screen or other activity can be seen. what I'm going to do is let my transparent activity handle the touch event if there is something drawn by the transparent activity, and let the other application behind deal the touch event when there is no content (transparent part). In short, how to let the transparent activtiy process some touch event and let the screen behind it deal the rest touch event. Any suggestion or skills will be appreciated. Thx -- 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] Re: How to send a motionEvent through a transparent activity
Not sure if I made this clear. In short, how to let the transparent activtiy process some touch event and let the screen behind it deal the rest touch event. 2009/12/9 Shawn Field banxia...@gmail.com Hi All, I made an activity with the transparent theme. When it starts up, the background home screen or other activity can be seen. what I'm going to do is let my transparent activity handle the touch event if there is something drawn by the transparent activity, and let the other application behind deal the touch event when there is no content (transparent part). Any suggestion or skills will be appreciated. -- 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] without Absolutelayout, how to put button on arbitary coordinates
Hi, Since the absolutelayout is deprecated, how to put a widget (suck as a button) on arbitary (X,Y) thx -- 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