cursor

How to change EditText cursor height?

匿名 (未验证) 提交于 2019-12-03 02:26:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to change the EditText cursor height, does anyone know how? 回答1: I had to dig far into the Android source to find the answer to this, but you essentially have to use padding on a custom shape drawable. note: only works on API 12 and greater due to support for textCursorDrawable Use positive top padding to move the top of your cursor higher User positive bottom padding to move the bottom of your cursor lower I usually end up using negative bottom padding to shorten the cursor because the it drops too low below baseline when you

EditText's cursor position

匿名 (未验证) 提交于 2019-12-03 02:24:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Assuming, that a user has written some text into an EditText and thereafter touched somewhere else on the screen, which caused the cursor position to change: How can one determine the new cursor position? 回答1: The simple version: myEditText.getSelectionStart(); If you want to react on an event you may try myEditText.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent event) { // view is myEditText here } }); event allows to distinguish between presses and releases. EditText also has a

How to get a email for particualr phone number

匿名 (未验证) 提交于 2019-12-03 02:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want get a email for a particular phone number. Here is my code private static String getEmailAndName(String number, Context context) { String selection = ContactsContract.CommonDataKinds.Phone.NUMBER+" like'%" + number +"%'"; String[] projection = new String[] {ContactsContract.CommonDataKinds.Phone.NUMBER, ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME, ContactsContract.CommonDataKinds.Phone.DATA}; Cursor c = context.getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, projection, selection, null, null);

What's the mechanism of setNotificationUri?

自闭症网瘾萝莉.ら 提交于 2019-12-03 02:22:26
问题 I've just implemented a CursorLoader and it works great! In fact, I didn't believe that my ListView would automatically update when the underlying data changed until I tested it. This apparently is the magic of setNotificationUri. My question is, how does it know when the data in the cursor has changed? Say I quietly insert an additional row somewhere. Does the underlying mechanism constantly query the database and compare it with the past data? Won't that be horribly inefficient if the

Creating custom simple cursor adapter

匿名 (未验证) 提交于 2019-12-03 02:19:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to create a very simple cursor custom cursor adapter to facilitate changing the colors of row items on click. Using the following code private static int save = -1; public void onListItemClick(ListView parent, View v, int position, long id) { parent.getChildAt(position).setBackgroundColor(Color.BLUE); if (save != -1 && save != position){ parent.getChildAt(save).setBackgroundColor(Color.BLACK); } save = position; } I got the code from this thread https://stackoverflow.com/a/7649880/498449 I would have used a simple cursor adapter and

Matplotlib: Cursor snap to plotted data with datetime axis

匿名 (未验证) 提交于 2019-12-03 02:17:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a plot of 3 data sets that have datetime objetcs on the x axis. I want to have a cursor that snaps to the data and shows the precise x and y value. I already have a "snap to cursor", but that only works for scalar x axes. Can anyone help me to modify the snap to cursor so that it works for datetime x axes as well? Here are my data plots: import numpy as np import matplotlib.pyplot as plot import matplotlib.ticker as mticker import matplotlib.dates as dates import datetime import Helpers fig = plot.figure(1) DAU = ( 2, 20, 25, 60, 190,

Caused by: java.lang.IllegalArgumentException: column '_id' does not exist

匿名 (未验证) 提交于 2019-12-03 02:15:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: i want to show my table using cursor and list view. but i got error. Caused by: java.lang.IllegalArgumentException: column '_id' does not exist but i didn't declare _id in my application. can somebody help me? this is my code in dbHelper. public Cursor DataPesanKeluar() { Cursor c = dba.rawQuery( " SELECT " + kel_id + "," + e_chiperteks + "," + k_nama + "," + kel_waktu + " FROM " + tbPesan + " INNER JOIN " + tbPesanKeluar + " ON " + tbPesan + "." + p_idpesan + "=" + tbPesanKeluar + "." + kel_idpesan + " INNER JOIN " + tbEnkrip + " ON " +

Android error: java.lang.IllegalStateException: trying to requery an already closed cursor

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: environment (Linux/Eclipse Dev for Xoom Tablet running HoneyComb 3.0.1) In my app I'm using the camera (startIntentForResult()) to take a picture. After the picture is taken I get the onActivityResult() callback and am able to load a Bitmap using a Uri passed via the "take picture" intent. At that point my activity is resumed and I get an error trying to reload the images into a gallery: FATAL EXCEPTION: main ERROR/AndroidRuntime(4148): java.lang.RuntimeException: Unable to resume activity {...}: java.lang.IllegalStateException: trying to

rawQuery(query, selectionArgs)

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to use select query for retrieving data from table. I have found, rawQuery(query, selectionArgs) method of SQLiteDatabase class to retrieve data. But I don't know how the query and selectionArgs should be passed to rawQuery method? 回答1: rawQuery("SELECT id, name FROM people WHERE name = ? AND id = ?", new String[] {"David", "2"}); You pass a string array with an equal number of elements as you have "?" 回答2: Maybe this can help you Cursor c = db.rawQuery("query",null); int id[] = new int[c.getCount()]; int i = 0; if (c.getCount() > 0)

mongodb cursor id not valid error

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to iterate through this loop: for doc in coll.find() I get the following error at the 100,000th plus record. File "build\bdist.win32\egg\pymongo\cursor.py", line 703, in next File "build\bdist.win32\egg\pymongo\cursor.py", line 679, in _refresh File "build\bdist.win32\egg\pymongo\cursor.py", line 628, in __send_message File "build\bdist.win32\egg\pymongo\helpers.py", line 95, in _unpack_response pymongo.errors.OperationFailure: cursor id '1236484850793' not valid at server what does this error mean? 回答1: Maybe your cursor timed