[android-developers] Search Query on Multiple Fragments

2016-02-03 Thread fadugba jeremiah
Hello I have been searching for a way to implements a search query on 
multiple fragments. I have tried asking it on StackOverflow but I couldnt 
get any good response. Please here 
 is the question. I really 
hope someone can help me out. Thanks. 

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/9db92cb1-0a3e-448e-b438-7a70a3054d1b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Search Query

2013-01-25 Thread ashwini vandanapu
ya, i read but i did not get any information.

On Fri, Jan 25, 2013 at 11:37 AM, TreKing treking...@gmail.com wrote:


 On Thu, Jan 24, 2013 at 11:39 PM, ashwini vandanapu 
 ashwini.vandan...@gmail.com wrote:

 I want to develop device search functionality. So how i have to implement


 Have you tried reading the documentation section on this topic?


 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

 --
 --
 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






-- 

ThanksRegards,
Ashwini V.

-- 
-- 
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] Search Query

2013-01-25 Thread skink


ashwini vandanapu wrote:
 ya, i read but i did not get any information.



how come you read it and still didn't get any information?

pskink

-- 
-- 
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] Search Query

2013-01-24 Thread TreKing
On Thu, Jan 24, 2013 at 11:39 PM, ashwini vandanapu 
ashwini.vandan...@gmail.com wrote:

 I want to develop device search functionality. So how i have to implement


Have you tried reading the documentation section on this topic?

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
-- 
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] Search Query Returns 0 rows

2010-05-20 Thread mike
hi guys,

this is my Query

String name = Mike
;   Cursor cursor = getContentResolver().query(Phones.CONTENT_URI,
null, Phones.NAME + =' + name + ', 
null,
Phones.NAME +  ASC);


and name exists in the database but it always returns nothing. could
you tell me whats wrong with this???

regards,
Randika

-- 
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] Search Query Returns 0 rows

2010-05-20 Thread mike
hi guys,

this is my Query

String name = Mike
;   Cursor cursor = getContentResolver().query(Phones.CONTENT_URI,
null, Phones.NAME + =' +
name + ', null,
Phones.NAME +  ASC);

and name exists in the database but it always returns nothing. could
you tell me whats wrong with this???

i'm just doing a simple search

main class

abstract public class mine extends ListActivity {
/** Called when the activity is first created. */
abstract SimpleCursorAdapter myAdapter(Intent intent);

Cursor cursor;
TextView stat;
String[] columns;
int[] names;

// abstract SimpleCursorAdapter makeMeAnAdapter(Intent intent);

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// setContentView(R.layout.main);
stat = (TextView) findViewById(R.id.label);
viewContacts();
setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);
onNewIntent(getIntent());
}

public void viewContacts() {
cursor = getContentResolver().query(Phones.CONTENT_URI, null,
null, null, Phones.NAME +  ASC);
startManagingCursor(cursor);
int x = cursor.getCount();
if (cursor == null || x == 0) {
// alert(Address Book, Empty Address Book);
}
columns = new String[] { People.NAME };
names = new int[] { R.id.label };
/*
 * myAdapter = new SimpleCursorAdapter(this, R.layout.main, 
cursor,
 * columns, names); setListAdapter(myAdapter);
 */
}

@Override
protected void onNewIntent(Intent intent) {
// TODO Auto-generated method stub
SimpleCursorAdapter adapter = myAdapter(intent);

if (adapter == null) {
finish();
} else {
setListAdapter(adapter);
}
}
}


Display class

public class Display extends mine {

@Override
SimpleCursorAdapter myAdapter(Intent intent) {
// TODO Auto-generated method stub

return (new
SimpleCursorAdapter(this,R.layout.main,cursor,columns,names));
}
}


search class


public class Search extends mine {
String[] str;
int id[];

@Override
SimpleCursorAdapter myAdapter(Intent intent) {
// TODO Auto-generated method stub
SimpleCursorAdapter adapter = null;
if (intent.getAction().equals(Intent.ACTION_SEARCH)) {
String query = 
intent.getStringExtra(SearchManager.QUERY);
Cursor c = searchItems(query);
Log.d(CURSOR_LENGHT, Integer.toString(c.getCount()));
adapter = new SimpleCursorAdapter(this, R.layout.main, 
c, str, id);
}
return (adapter);
}

private Cursor searchItems(String query) {
Cursor cur = getContentResolver().query(People.CONTENT_URI, 
null,
People.NAME + =' + query + ', null, null);
startManagingCursor(cur);
int x = cur.getCount();
if (cur == null || x == 0) {
// alert(Address Book, Empty Address Book);
}
if (cur.moveToNext()) {
do {
Log.d(CURSOR_, Integer.toString(x));
} while (cur.moveToNext());
}
str = new String[] { People.NAME };
id = new int[] { R.id.label };
return cur;
}
}

androidmanifest.xml

?xml version=1.0 encoding=utf-8?
manifest xmlns:android=http://schemas.android.com/apk/res/android;
package=com.test android:versionCode=1 android:versionName=1.0
application android:icon=@drawable/icon android:label=@string/
app_name android:debuggable=true
activity android:name=.Display 
android:label=@string/app_name
intent-filter
action 
android:name=android.intent.action.MAIN /
category 
android:name=android.intent.category.LAUNCHER /
/intent-filter
meta-data android:name=android.app.default_searchable
 android:value=.Search /
/activity

activity
android:name=.Search
android:label=Search
android:launchMode=singleTop
intent-filter