Re: [android-beginners] Re: SQLiteConstraintException: error code 19: constraint failed when deleting from sqlite
I don't think this is the case. When i try to delete album that contains songs i got java.sql.SQLException: album has songs cannot be deleted at org.sqlite.DB.execute(DB.java:275) at org.sqlite.DB.executeUpdate(DB.java:281) at org.sqlite.PrepStmt.executeUpdate(PrepStmt.java:77) On Thu, Jul 29, 2010 at 3:16 PM, DanH danhi...@ieee.org wrote: SELECT RAISE(FAIL,'album has songs cannot be deleted')); On Jul 29, 5:43 am, manigault manig...@gmail.com wrote: Hi all, i have simple relation between songs and albums one to many. I created the album table like this CREATE TABLE albums (id INTEGER PRIMARY KEY ASC, name TEXT, additional TEXT) My song table is like this StringBuilder sqlQuery = new StringBuilder(); CREATE TABLE songs (id INTEGER PRIMARY KEY ASC, album_fk INTEGER NOT NULL, title TEXT, url TEXT, duration BIGINT NOT NULL) and i have trigger to check when i wan't to delete an album if there are songs in it CREATE TRIGGER trigger_on_delete BEFORE DELETE ON albums FOR EACH ROW BEGIN SELECT RAISE(FAIL,'album has songs cannot be deleted')); WHERE (SELECT album_fk FROM songs WHERE album_fk = OLD.id) IN NOT NULL;) END and everything is ok and its working fine. But sometimes i got this error Exception: android.database.sqlite.SQLiteConstraintException: error code 19: constraint failed Stack Trace : android.database.sqlite.SQLiteStatement.native_execute(Native Method) android.database.sqlite.SQLiteStatement.execute(SQLiteStatement.java: 66) when i am trying to delete an album. I know what #define SQLITE_CONSTRAINT 19 /* Abort due to constraint violation */ stands for but i can't what constraints can be violated when deleting an album. I can't reproduce this so i can't debug it to find out what's the problem any ideas what could go wrong and cause such error. I've tried playing with string encoding but i think that's not the problem. -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
Re: [android-beginners] share stuff to social networks
So you mean i have to implement connection to all apis by myself. But how to get information about what clients are installed on device ? On Fri, May 28, 2010 at 2:50 PM, wahib haq wahib.t...@gmail.com wrote: You can implement integration of social media using their respective API's for example fbconnect for facebook and many twitter api's are available too. So you can create your custom dialog with links to these social medias. regards, wahib On Fri, May 28, 2010 at 1:33 PM, manigault manig...@gmail.com wrote: Hi all, When you go to gallery and hit menu there is share button. The interesting about it is that it gives you choice to share your picture over some social networks but only for those that you have installed a client on the device. The same widget/dialog is used in other application for example contacts, so my question is how can i show such dialog/widget in my app. Is there some build in functionality that i can use ? Thanks in advance. -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -- Wahib-ul-haq 3rd year Communications Engineering Student, NUST, Pakistan. Microsoft Student Partner NUST-SEECS Open Mobile Squad ( Android Dev Team ) Software Internee @ Cogilent Solutions Blog: www.livetechpro.com web: http://www.google.com/profiles/wahib.tech follow me on twitter @wahibhaq -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: scaling ImageView
If set Scale type = CENTER_CROP nothing happens the image is still resized to match ImageView bounds On Mon, May 3, 2010 at 11:04 AM, manigault manig...@gmail.com wrote: Hi all, i have ImageView which is taking rectangular layout width = 40dp height = 30dp and images that i'am displaying are 40x40 and they are scaled to rectangle. How can i tell the ImageView not to scale the image but to cut the image parts that not fit in the size. I want the image to stay 40dp height and to cut 5 dp from top and botton. -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
Re: [android-beginners] Images Reused in a ListView
Can you paste some code On Tue, Apr 20, 2010 at 5:19 PM, Tom F M White fred...@gmail.com wrote: I've made a custom ListAdaptor, with associated View, that displays an icon on the left of each list item, with three lines of text to the right. In MyView.onCreate(), the icons are populated using imageView.setImageDrawable(Drawable.createFromStream(URL)); each item on the list is it's own object, so each of these is done individually for each list item. However when viewing the list, the first few items display correctly, but as you scroll down the list, those images that were not visible initially are replaced with the same images used in the top few items, so 4/5 images end up reused for the entire list. The text for each list item is correct. What is going wrong? Tom -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: listview selector problem with g1
Sorry for the question i found the solution must se cache color hint attribute On Mon, Mar 22, 2010 at 12:56 PM, manigault manig...@gmail.com wrote: Hi all, I have listview with custom selector for it. On nexus 1 is working fine but on g1 when i am scrolling it set the default background for all items during scroll. The strange thing is that on nexus is working but this is happening only on g1. Here is the code of the selector - ?xml version=1.0 encoding=utf-8? selector xmlns:android=http://schemas.android.com/apk/res/android; item android:state_focused=true android:state_pressed=true android:drawable=@drawable/custom_background / item android:state_focused=false android:state_pressed=true android:drawable=@drawable/custom_background / item android:state_focused=true android:drawable=@drawable/custom_background / /selector Any ideas ? -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en To unsubscribe from this group, send email to android-beginners+unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject.
Re: [android-beginners] Re: listview fill parent
Hey thanks for the reply but it's still not working. Here is some code - main.xml - xml containing the listview ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/android; android:layout_width=fill_parent android:layout_height=fill_parent ListView android:layout_height=fill_parent android:layout_width=fill_parent android:id=@+id/listview/ListView /LinearLayout item.xml - xml used for inflating listview items ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/android; android:layout_width=fill_parent android:layout_height=fill_parent TextView android:id=@+id/textview android:layout_height=fill_parent android:layout_width=fill_parent/TextView /LinearLayout and i am using ArrayAdapter for populating items in listview super.onCreate(savedInstanceState); setContentView(R.layout.main); ListView listView = (ListView)findViewById(R.id.listview); listView.setAdapter(new ArrayAdapterString(this,R.layout.item,R.id.textview,new String[]{line 1, line 2, line 3})); but still the items don't fill the whole height -- Forwarded message -- From: Javadid its.va...@gmail.com Date: Sat, Mar 6, 2010 at 7:04 AM Subject: [android-beginners] Re: listview fill parent To: Android Beginners android-beginners@googlegroups.com Well first of all there are 2 possible ways by which u might be getting each row item... 1 is by defining them in an xml and inflating them at runtime and the other is by directly initiating it through code... supposing that u have used the xml inflation method all u have to do is define the list's width = fill_parent... and similarly in the properties of the xml u have created for items u must have used Linear/ Relative layout in which all items reside... just change its width parameter from wrap_content to fill_parent... this will do the trick... if it doesnt then we'll have to look at the xml of your row which u inflate or incase of making it dynamically through code, we'll have to have a look at the code... On Mar 5, 3:08 pm, Martin Obreshkov manig...@gmail.com wrote: I am sorry for the misleading question - i want the listview items to be stretched to the whole listview On Fri, Mar 5, 2010 at 12:00 PM, manigault manig...@gmail.com wrote: Hi all i have a listview with small number of items but they are still fetched dynamically. How can i make my list view to fill to whole screen no not depending on number of items -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: listview fill parent
I am sorry for the misleading question - i want the listview items to be stretched to the whole listview On Fri, Mar 5, 2010 at 12:00 PM, manigault manig...@gmail.com wrote: Hi all i have a listview with small number of items but they are still fetched dynamically. How can i make my list view to fill to whole screen no not depending on number of items -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: listview scroll position
Sorry for the post my mistake i just reload every time the view in onResume :) On Fri, Sep 11, 2009 at 2:45 PM, manigault manig...@gmail.com wrote: I have a listview and when i select an item a new activity is started, but when i go back the listview's scroll is positioned at the beginning the list. How can i save the scroll position and when i go back to the listview the scroll to be positioned in the same place. -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Empty list
Thanks :) On Thu, Sep 10, 2009 at 2:16 PM, Mark Murphy mmur...@commonsware.com wrote: manigault wrote: id=@id/android:empty works for ListActivity but when i use it for a listview which is in a regular activity it doesn't. How to show text when the list is empty for a listview. For an empty list, just make the ListView be invisible (setVisibility(View.INVISIBLE)) and make an associated TextView be visible. Use FrameLayout (or RelativeLayout) so they can take up the same space in the GUI, just one or the other being visible. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need Android talent? Ask on HADO! http://wiki.andmob.org/hado -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView item stay selected
Thanks a lot it's really very simple and clear using ContextMenu On Fri, Aug 28, 2009 at 1:14 AM, Justin Andersonjanderson@gmail.com wrote: The preferred way is to use a long-press to bring up a context menu. The menu populated by pressing the menu button should be used for things that do not require a selection. -- There are only 10 types of people in the world... Those who know binary and those who don't. -- On Tue, Aug 25, 2009 at 9:30 AM, Martin Obreshkov manig...@gmail.com wrote: Thanks for the reply but if this is not the recommended way what is the solution for it. For example i have a list with mails and when i select given mail there are actions i can perform(delete, reply). What is the best way to implement this, should i use listview at all. Thanks in advance. On Tue, Aug 25, 2009 at 5:39 PM, Mark Murphymmur...@commonsware.com wrote: I have a listview and i want when i select a row to stay selected The core Android team does not recommend this. The problem is that if i change some attribute ( for example v.setBackgroundColor(Color.BLACK) ) the selected view no longer stays selected. That is because selected is one of the background colors. A widget background is usually some form of ColorStateList. You can supply a simple color to setBackgroundColor(), but that only works if you do not intend to allow the item to be selected, for example. -- Mark Murphy (a Commons Guy) http://commonsware.com Android App Developer Books: http://commonsware.com/books.html -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Change the color of the EditBox hint
android:textColorHint=# sry for the post On Wed, Aug 26, 2009 at 12:21 PM, manigaultmanig...@gmail.com wrote: How can i change the color of the EditBox hint text. Thanks :) -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: ListView item stay selected
Thanks for the reply but if this is not the recommended way what is the solution for it. For example i have a list with mails and when i select given mail there are actions i can perform(delete, reply). What is the best way to implement this, should i use listview at all. Thanks in advance. On Tue, Aug 25, 2009 at 5:39 PM, Mark Murphymmur...@commonsware.com wrote: I have a listview and i want when i select a row to stay selected The core Android team does not recommend this. The problem is that if i change some attribute ( for example v.setBackgroundColor(Color.BLACK) ) the selected view no longer stays selected. That is because selected is one of the background colors. A widget background is usually some form of ColorStateList. You can supply a simple color to setBackgroundColor(), but that only works if you do not intend to allow the item to be selected, for example. -- Mark Murphy (a Commons Guy) http://commonsware.com Android App Developer Books: http://commonsware.com/books.html -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] buttons in listview
I have a ListActivity and in each listview item i have textview and a button, when i select an item from the text view the button become visible ( by default it is GONE ) so far so good :). But when the button become visible i can't the select the same item again, the onListItemClick method is not invoked only the button received click events. Who can i know when the item is selected again. Thanks in advance -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] ListView Item lost focus event
Hi when i select item in listview and then scroll it the selected item in no more highlighted. Can e register listener for this event ( when the item come unselected ). -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Send Mail NOT from user account
Hi, i want to send a e-mail from a android activity using alternative smtp server ( for example smpt.myserver.com) and not using the user account (example u...@myserver.com). I can do this using external java libraries ( JavaMail ) but is there a way to do this using the android sdk. -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---