android-2.1-eclair

URI validation in JavaScript

淺唱寂寞╮ 提交于 2021-02-08 13:20:08
问题 What is a robust way (doesn't have to be regex, does it?) to validate that a URI works on Android by only using JavaScript? That is, the check is not done in Java on the Android SDK side; it's done in a webpage using JavaScript. EDIT: By "works on Android", I mean that Android can find an Activity that responds to an Intent using that URI. 回答1: Javascript is never as robust as backend but there are plenty off decent regex's around. This is covered in another post here Trying to Validate URL

Swipe Gesture inside ListView - Android [closed]

别等时光非礼了梦想. 提交于 2020-01-22 16:49:26
问题 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 am a newbie for Android. I got a tutorial on how to implement the `listView here: I implemented it and it is working fine. I need to implement a ViewSwitcher for the same. Like when I swipe the song, I need to

Dynamically change android soft keyboard language setting?

这一生的挚爱 提交于 2020-01-03 04:16:05
问题 I have some edit boxes in my app, some of them I will input English text, some of them I will input Spanish. I'm using the standard android soft keyboard, however as my device locale is set to English, when I type Spanish in one of my "Spanish" edit boxes, the English corrective text/predictive text makes this difficult. The only workaround I've found, is to go into the device settings and change the language over, but this is quite annoying. Is there anyway I could have some kind of button,

Android: Custom View with object reference from attrs.xml, always null

梦想与她 提交于 2019-12-31 03:15:51
问题 I'm trying to setup a relationship hierarchy between objects. Every object has a parent of the same type as itself, or null . I have a main.xml that contains some of these: <com.morsetable.MorseKey android:id="@+id/bi" android:layout_weight="1" custom:code=".." custom:parentKey="@id/be" android:text="@string/i" /> a res/values/attrs.xml that contains one of these: <declare-styleable name="MorseKey"> <attr name="code" format="string"/> <attr name="parentKey" format="reference"/> </declare

Android start activity on Menu Item selection

吃可爱长大的小学妹 提交于 2019-12-30 03:09:15
问题 I have 2 classes. One will be a basic instructions screen and on that screen it will have a menu that will let you go to the other class. The other class is a MapActivity. I believe the problem is that its not finding the other class. I've tried a few different ways of declaring the intent to find the class. This is the latest thing I've tried: @Override public boolean onCreateOptionsMenu(Menu menu){ MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.mainmenu, menu); return

Automatically answer call in android 2.1

十年热恋 提交于 2019-12-25 05:14:16
问题 I am looking for some code to automatically answer incoming call in android 2.1. I have looked on some of the available threads on stack-overflow but they do not seem to work for Android 2.1. Can anybody give some peace of code to help me. Thanks in advance. 回答1: // Set up communication with the telephony service (thanks to Tedd's Droid Tools!) TelephonyManager tm = (TelephonyManager) getSystemService(TELEPHONY_SERVICE); Class c = Class.forName(tm.getClass().getName()); Method m = c

Automatically answer call in android 2.1

让人想犯罪 __ 提交于 2019-12-25 05:14:03
问题 I am looking for some code to automatically answer incoming call in android 2.1. I have looked on some of the available threads on stack-overflow but they do not seem to work for Android 2.1. Can anybody give some peace of code to help me. Thanks in advance. 回答1: // Set up communication with the telephony service (thanks to Tedd's Droid Tools!) TelephonyManager tm = (TelephonyManager) getSystemService(TELEPHONY_SERVICE); Class c = Class.forName(tm.getClass().getName()); Method m = c

Analogue of android:filterTouchesWhenObscured for API level below 9

[亡魂溺海] 提交于 2019-12-22 08:55:32
问题 Starting with API level 9, there's android:filterTouchesWhenObscured attribute and corresponding setFilterTouchesWhenObscured method on ViewGroup . For example, when a view has onClickListener set and another view obscures that view (e.g. an overlay panel, a toast, or anything else), then touches will not be passed to the obscured view - in my example, onClick will not be fired. However, this is not available in API level 7 - and for my project the requirement is Android 2.1 and above, which

ConnectivityManager getActiveNetworkInfo() is always null even with data traffic active

巧了我就是萌 提交于 2019-12-22 04:29:18
问题 i'm working on a android project and i had the need to check for internet connection. i searched the web and i found a solution here on stackoverflow. However, i'm having problems on checking the internet state. I already searched everywhere but i can't find any solution for my problem. Here is the manifest: <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name=

How can I force a GridView to use the whole screen (regardless of display size)?

[亡魂溺海] 提交于 2019-12-17 19:48:08
问题 I've got the following layout file, which has a GridView and an ImageView behind that as the background. <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#FFFFFF"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|right" android:layout_marginRight="-70dp" android:layout