android-widget

Disabling SearchView

大城市里の小女人 提交于 2019-12-05 07:38:11
I'm trying to disable a SearchView from my Activity . I tried the following code : mSearchView.setEnabled(false); mSearchView.setFocusable(false); mSearchView.setClickable(false); But it does not work. SearchView can still be clicked and KeyBoard popps up. I want it to become greyed out and unclickable. How can I accomplish this? None of the stated answers were sufficient for my needs, so I would like to provide another one for anybody in the same situation. A SearchView is made up of different Views, which can be - and in this case have to be - addressed individually. If you want your

Android: Align LinearLayout center for all screen sizes

若如初见. 提交于 2019-12-05 07:35:06
I want to design a layout for my login screen, I tried the following codes. Using some hardcoded values I got my center green color layout center for some screen sizes. I know using hardcoded values wont work on different screen sizes. I tried numerous stuffs on SO. Please provide me the best way <?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" android:background="@drawable/background" > <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

How to bind any image with the captured Camera image before saving it? [duplicate]

雨燕双飞 提交于 2019-12-05 07:28:34
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Android: How to overlay-a-bitmap/draw-over a bitmap? I have implement the android Camera functionality in amy application. Now i want to combine any transperent image with that captured camera Image before to save that image in to gallery, then how it can be done ?? Any code will be realy appereciated. Thanks. Edit: I am using this Code to captured and Save the Image So, How shoud i have to Implement Such things

Android get Video source path from VideoView

倖福魔咒の 提交于 2019-12-05 06:39:52
I have VideoView instance. I need to know video source path from it. Is it possible? Can anybody help me? My code from WebChromeClient class is: @Override public void onShowCustomView(final View view, final CustomViewCallback callback) { super.onShowCustomView(view, callback); if (view instanceof FrameLayout) { final FrameLayout frame = (FrameLayout) view; if (frame.getFocusedChild() instanceof VideoView) { // get video view video = (VideoView) frame.getFocusedChild(); } } } How to get video source path fron video object ? VideoView doesn't have getters for video path/Uri. Your only chance is

Widget does not respond

…衆ロ難τιáo~ 提交于 2019-12-05 06:26:04
问题 I have Widget that uses a service to update. It has button on it to open the activity. It works perfectly. However, sometimes i click on the widget to open the activity and it wont work or update. My question is: what kills an app widget. And if the widget is dead, why is it still showing on the screen. Is there anyway to relive that specific widget without creating another. Thanks 回答1: Android will stop your widget when it faces a low memory situation. Then it will restart your home widget

How to make the Next and Previous Button code for the below ArrayList?

﹥>﹥吖頭↗ 提交于 2019-12-05 06:18:14
问题 I have made the ArrayList and addind the value one by one in it by the coading. I can able to see that whole arrayList as like below code: // TO DISPLAY DATA for(int j=0;j<tempEmployerList.size();j++) { System.out.println("================ Employee: "+(j+1)+"======================"); m = new Employer(); m=tempEmployerList.get(j); //System.out.println("TaxCodeHeading: "+(j+1)+" = "+m.getOrderName()); System.out.println("TaxCode: "+(j+1)+" = "+m.getTaxcode()); System.out.println("PayPeriod: "+

auto scroll a Gallery widget

ぐ巨炮叔叔 提交于 2019-12-05 06:11:31
I need to implement a gallery which scrolls one item at a time, and which can do 'autoscroll': i.e. every couple of seconds, it automatically scrolls to the next item. As per this thread: Android: Programmatically animate between images in Gallery widget , I extended Gallery, overriding onFling to ignore the fling event and instead simulate a DPAD arrow left or right in order to move a single item at a time: @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { int kEvent; if(isScrollingLeft(e1, e2)){ //Check if scrolling left kEvent = KeyEvent

Transaction details from paypal using Pay-key in android

笑着哭i 提交于 2019-12-05 05:27:48
问题 I am integrating paypal in my application and everything is working fine.Now i wanted to have all transaction details from paypal in my android and so using paykey i tried to write a code..My code for obtaining transaction detail is as follow: if(resultTitle == "SUCCESS") { try{ HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = null; httppost = new HttpPost("https://svcs.sandbox.paypal.com/AdaptivePayments/PaymentDetails"); httppost.setHeader("Content-Type", "application/x

How to create an iOS style arrow button in Android?

落爺英雄遲暮 提交于 2019-12-05 04:22:55
问题 I am partial to dual use buttons in iOS, like in the image below: How can I create these types of buttons in Android? In other words, the entire button must be clickable, the arrow must be right-aligned and the text of the button must be left aligned. I tried playing with a regular Button widget, but no luck. Do I have to resort to a Table layout (but then the clickability would be lost). 回答1: You will need customized shape background for the Button You can find customizing shape here. Set

Resize android datepicker control

岁酱吖の 提交于 2019-12-05 04:16:05
How can one resize the initial size of android datepicker control to be smaller or bigger. Is there only way to reimplement it? I haven't been able to figure out a way to resize it, but have seen implementations where they utilize the DatePicker as a dialog. The date is rendered as TextView with an edit button, which launches the DatePicker dialog. It saves screen real estate when not editing... http://developer.android.com/resources/tutorials/views/hello-datepicker.html To resize the datepicker go the xml and and add android:scaleX and android:scaleY to the appropriate size you need. Mar Bar