android-widget

How to get width and height of a Webview in android

谁说我不能喝 提交于 2019-12-19 00:55:41
问题 I want to determine the width and the height of the WebView . I have already tried it using: webView.getWidth(); webView.getHeight(); but the resulting log always shows them to be 0. 回答1: Here's a more elegant solution public void onCreate(Bundle savedInstanceState) { webView = (WebView) findViewById(R.id.webView1); webView.addOnLayoutChangeListener(new OnLayoutChangeListener() { @Override public void onLayoutChange(View v, int left, int top, int right,int bottom, int oldLeft, int oldTop, int

autoLink for map not working

筅森魡賤 提交于 2019-12-18 20:47:41
问题 I have the following TextView in my XML layout file:- <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/autolink_test" android:autoLink="all" /> The string autolink_test contains a phone number, an email address, a website address and a physical geographical address. While the first three are showing up correctly as clickable autolinks, the address does not. Only the zipcode part shows up as an autolink... and that too as a phone number!

How to change android tab text on the fly?

夙愿已清 提交于 2019-12-18 19:06:28
问题 This seems like it should be simple, but I can't figure out a way to do it. I'm needing a tab to have beginning text, but then have that text change after the user selects an item from a list. I know how to change tab backgrounds and colors via mTabHost.getChildAt(index).setBackgroundColor(); but there isn't an option to change the tab's indicator. I've tried using an EditText. private EditText tabName; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate

Android widget not showing up on the list after developed

守給你的承諾、 提交于 2019-12-18 14:02:27
问题 I'm upgrading my app with widget. It's not the first widget I've done. I was always encountering weird issues, but the widget was shwoing up on the list eventually. Here is what I've done so far: Created widget_layout.xml Created widget_info.xml <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:minWidth="110dp" android:minHeight="30dp" android:updatePeriodMillis="86400000" android:initialLayout="@layout/widget_layout" android:resizeMode="none"> </appwidget

animated transition between an activity and another [closed]

眉间皱痕 提交于 2019-12-18 13:26:06
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I state that i'm not very experienced in android, and I would like to understand, perhaps with some tutorial, how to implement any scrolling animation between one activity and another. I hope in your help 回答1:

Android Lockscreen API?

假装没事ソ 提交于 2019-12-18 12:37:08
问题 I've seen two apps that can customize lockscreens: Widget locker, slidescreen. Do we really have an API that lets us customize the lockscreen? If not, what is the trick? 回答1: See mylockforandroid: mylockforandroid Its GPL'ed but you will get the code tricks by viewing source. 来源: https://stackoverflow.com/questions/4181615/android-lockscreen-api

Difference between TextInputLayout and TextInputEditText

孤街醉人 提交于 2019-12-18 12:08:54
问题 Need to know what actually difference between TextInputEditText and TextInputLayout, When should we use one of them. 回答1: They are different layouts that complement each other functionalities. TextInputLayout extends LinearLayout TextInputEditText extends EditText They were meant to be used together like following: <TextInputLayout> <TextInputEditText/> </TextInputLayout> It's all there on the official docs: TextInputLayout: https://developer.android.com/reference/android/support/design

Unexplainable ClassCastException in android.widget.ProgressBar.onRestoreInstanceState

守給你的承諾、 提交于 2019-12-18 12:07:10
问题 I've had my application out in the store for a while, but it seems it crashes occasionally according to the crash reports in the Developer Console, saying: java.lang.ClassCastException in android.widget.ProgressBar.onRestoreInstanceState with the stack trace: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.company.myapp/com.mycompany.myapp.activity.MyActivity}: java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to android.widget.ProgressBar

Skewing a text view in Android

人盡茶涼 提交于 2019-12-18 11:57:18
问题 I'm looking to replicate the following within my application: As you can see, its basically a button which increases/decreases the value of the text view contained within it. This button will have three visual states -> unpressed, decrease and increase (as seen in the image above, the user taps the increase arrows and the button appears pressed in on that side) Here are my 3 button states currently: As you can see, the problem I have is being able to correctly skew/rotate the text view so it

Disable All Touch Screen Interactions While Animation

女生的网名这么多〃 提交于 2019-12-18 11:53:09
问题 I wish to disable all the touch screen interactions while an animation is being displayed. I don't wish to use the setClickable() method on the buttons at the start or end of the animation because there are a large number of buttons. Any suggestions? 回答1: In your Activity, you can override onTouchEvent and always return true; to indicate you are handling the touch events. You can find the documentation for that function there. Edit Here is one way you can disable touch over the whole screen