Search Results

Search found 13533 results on 542 pages for 'android activity'.

Page 15/542 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Re-load Android activity data

    - by rhinds
    Hi, I am writing an Android app, part of which will be a survey involving multiple pages of checkbox question and answers. I have created an activity to display the question and options (from the DB) and what I want to do now is when i press the "Next" button it should just reload the current activity with the next question set from the database. (the activity starts with survey.getNextQuestion() - so its just a case of refreshing the activity so it updates) Im sure this is a simple thing to do -any ideas? Thanks

    Read the article

  • Gnome Activity Journal does not show recently used files

    - by Nik
    I am running ubuntu 10.10, and installed Gnome Activity Journal. However it does not show any recently used files. I have attached a screenshot below. Please note that gnome activity journal has been installed on the system for quite some time. So it is not that I recently installed and it still has to slowly gather data. Also the zeitgeist-daemon is running in the background. Would reinstalling zeitgeist help solve this problem? If yes could you please provide a ppa where I can find the latest stable release of zeitgeist.

    Read the article

  • Android: Get the X and Y coordinates of a TextView?

    - by Jep Knopz
    I am working now on a project. I have 2 draggable textView in a circle. I want to add those value inside the circle when the circle is drag over the other circle. the first option that I have is to get the X and Y of the circle, but I get it. Can anyone fix my code? Here is the Code: MainActivity public class MainActivity extends Activity { int windowwidth; int windowheight; TextView bola; TextView bola2; private float x; private float y; private android.widget.RelativeLayout.LayoutParams layoutParams; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); windowwidth = getWindowManager().getDefaultDisplay().getWidth(); windowheight = getWindowManager().getDefaultDisplay().getHeight(); bola = (TextView) findViewById(R.id.ball); bola2 = (TextView) findViewById(R.id.ball2); bola2.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { // TODO Auto-generated method stub layoutParams = (RelativeLayout.LayoutParams) bola2 .getLayoutParams(); switch (event.getActionMasked()) { case MotionEvent.ACTION_DOWN: break; case MotionEvent.ACTION_MOVE: int x_cord = (int) event.getRawX(); int y_cord = (int) event.getRawY(); if (x_cord > windowwidth) { x_cord = windowwidth; } if (y_cord > windowheight) { y_cord = windowheight; } layoutParams.leftMargin = x_cord - 25; layoutParams.topMargin = y_cord - 75; bola2.setLayoutParams(layoutParams); break; default: break; } return true; } }); bola.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { layoutParams = (RelativeLayout.LayoutParams) bola .getLayoutParams(); switch (event.getActionMasked()) { case MotionEvent.ACTION_DOWN: break; case MotionEvent.ACTION_MOVE: int x_cord = (int) event.getRawX(); int y_cord = (int) event.getRawY(); if (x_cord > windowwidth) { x_cord = windowwidth; } if (y_cord > windowheight) { y_cord = windowheight; } layoutParams.leftMargin = x_cord - 25; layoutParams.topMargin = y_cord - 75; bola.setLayoutParams(layoutParams); break; default: break; } // TODO Auto-generated method stub return true; } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_main, menu); return true; }} Activity_main.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <TextView android:id= "@+id/ball" android:background="@drawable/bgshape" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="1" tools:context=".MainActivity" /> <TextView android:id= "@+id/ball2" android:background="@drawable/bgshape" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="2" tools:context=".MainActivity" android:layout_x="60dp" android:layout_y="20dp" /> The bgshape.xml(for the circle) <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" > <padding android:bottom="20dp" android:left="25dp" android:right="25dp" android:top="20dp" /> <stroke android:width="2dp" android:color="#000000" /> <solid android:color="#ffffff" /> <corners android:bottomLeftRadius="30dp" android:bottomRightRadius="30dp" android:topLeftRadius="30dp" android:topRightRadius="30dp" /> This code works well. Could anyone fix this so that I can add the value inside the circle when they hit each other?

    Read the article

  • Intercept creation of activities when the application is restored

    - by Johan Bilien
    Most of our activities access a user-specific model. All these activities inherit from a ModelActivity base class, which provides a getModel() call. When one of these activities detect that the user has signed out (through the AccountManager callback), it sticks to its existing model, but prepares to exit back to the root activity (which is not user-specific) by starting its intent with FLAG_ACTIVITY_CLEAR_TOP. If however the user deletes an account while the app is not running, we run into trouble when the activity is restored. Now the activity needs to handle there not being a model, which makes the code more complicated and bug-prone. Ideally we would intercept the application restore process before the activity is created. Then we would check whether we have an account and a model, and if not clear up the saved stack of activities, and restart from our root activity instead of the last saved activity. But as far as I can tell the first place where we can run code is in the onCreate callback of the activity. Is there a way to run some code when the application is restored from background-saving, but before the saved activity is created?

    Read the article

  • Android: How can i access email addresses in android

    - by Maxood
    I have the following code through which i am able to retrieve phone numbers. Somehow , i am not able to retrieve email addresses by using android.provider.Contacts.People API. Any ideas? import android.app.AlertDialog; import android.app.ExpandableListActivity; import android.content.ContentUris; import android.content.Context; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.provider.Contacts.People; import android.view.View; import android.widget.ExpandableListAdapter; import android.widget.SimpleCursorTreeAdapter; import android.widget.TextView; import android.widget.ExpandableListView.OnChildClickListener; public class ShowContacts extends ExpandableListActivity implements OnChildClickListener { private int mGroupIdColumnIndex; private String mPhoneNumberProjection[] = new String[] { People.Phones._ID, People.NUMBER // CHANGE HERE }; private ExpandableListAdapter mAdapter; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Query for people Cursor groupCursor = managedQuery(People.CONTENT_URI, new String[] {People._ID, People.NAME}, null, null, null); // Cache the ID column index mGroupIdColumnIndex = groupCursor.getColumnIndexOrThrow(People._ID); // Set up our adapter mAdapter = new MyExpandableListAdapter(groupCursor, this, android.R.layout.simple_expandable_list_item_1, android.R.layout.simple_expandable_list_item_1, new String[] {People.NAME}, // Name for group layouts new int[] {android.R.id.text1}, new String[] {People.NUMBER}, // AND CHANGE HERE new int[] {android.R.id.text1}); setListAdapter(mAdapter); } public class MyExpandableListAdapter extends SimpleCursorTreeAdapter { public MyExpandableListAdapter(Cursor cursor, Context context, int groupLayout, int childLayout, String[] groupFrom, int[] groupTo, String[] childrenFrom, int[] childrenTo) { super(context, cursor, groupLayout, groupFrom, groupTo, childLayout, childrenFrom, childrenTo); } @Override protected Cursor getChildrenCursor(Cursor groupCursor) { // Given the group, we return a cursor for all the children within that group // Return a cursor that points to this contact's phone numbers Uri.Builder builder = People.CONTENT_URI.buildUpon(); ContentUris.appendId(builder, groupCursor.getLong(mGroupIdColumnIndex)); builder.appendEncodedPath(People.Phones.CONTENT_DIRECTORY); Uri phoneNumbersUri = builder.build(); return managedQuery(phoneNumbersUri, mPhoneNumberProjection, null, null, null); } } @Override public boolean onChildClick(android.widget.ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { AlertDialog dialog = new AlertDialog.Builder(ShowContacts.this) .setMessage(((TextView) v).getText().toString()) .setPositiveButton("OK", null).create(); dialog.show(); return true; } }

    Read the article

  • Android: Expand ListView to fill space between two items

    - by BahaiResearch.com
    I have a ListView that is sandwiched between two buttons. The entire screen is in a ScrollView <Button android:text="Take a Picture" android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/btnPicture" android:layout_marginRight="3dp" android:layout_marginLeft="3dp" android:layout_marginTop="5dp" android:textSize="25dp"/> <ListView android:minWidth="25px" android:minHeight="25px" android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/lstPhotos" android:visibility="gone" /> <Button android:text="Location Type" android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/btnLocationType" android:layout_marginRight="3dp" android:layout_marginLeft="3dp" android:layout_marginTop="5dp" android:textSize="25dp" /> As I add items to the listview in code, how can I get the listview to take up enough space to be visible. It does expand to show 1 item but after I add the second item it doesn't expand any more. You can see here after I added a second picture row to the listview, it's not visible.

    Read the article

  • Android: SlidingDrawer disappears under SurfaceView

    - by ykrasik
    Hi, I'm trying to create a SlidingDrawer with LinearLayout content over a FrameLayout. At first it all seems fine, I get my SlidingDrawer's handle at the bottom of the screen. But then, if I start dragging the handle up and the content starts showing, it gets clipped by the border rectangle of the handle. If I drag the handle all the way up the entire content eventually gets shown, however if I now drag the handle down, it will be clipped by the border rectangle of the content. Also, if the handle is all the way up, as soon as I start dragging it the whole content disappears. I can still click on where the handle should be on the screen, drag it and the content would show, but I need to guess where the handle is. What seems to be causing this is the fact that I have a SurfaceView in the xml file just before SlidingDrawer. Removing the view from the xml solves this problem, however I need this view. Here's the xml: <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <!-- Removing this DrawView from here solves the problem --> <com.package.DrawView android:id="@+id/main" android:layout_width="fill_parent" android:layout_height="fill_parent" /> <SlidingDrawer android:id="@+id/SlidingDrawer" android:layout_width="wrap_content" android:layout_height="wrap_content" android:allowSingleTap="true" android:animateOnClick="true" android:handle="@+id/slideHandleButton" android:content="@+id/contentLayout" android:padding="10dip"> <Button android:id="@+id/slideHandleButton" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/sliding_button"> </Button> <LinearLayout android:id="@+id/contentLayout" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical"> <Button android:id="@+id/clearButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Test"> </Button> </LinearLayout> </SlidingDrawer> </FrameLayout> Java: package com.package; import android.app.Activity; import android.os.Bundle; public class SlideTest extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } } package com.package; import android.content.Context; import android.util.AttributeSet; import android.view.SurfaceView; public class DrawView extends SurfaceView { public DrawView(Context context, AttributeSet attrs) { super(context, attrs); } } Edit: I just noticed that if DrawView extends View and not SurfaceView this problem goes away. However, I'm using a dedicated drawing thread and according to the documentation (and LunarLander example) when using a dedicated drawing thread, it should draw to a SurfaceView. Any help would be greatly appreciated!

    Read the article

  • Error inflating class android.widget.CompoundButton

    - by snctln
    [Disclaimer: This has been cross posted on the Android Developers Google Group I am trying to use a CompoundButton in a project I am working on. Every time I try and use it by declaring it in my layout xml file I receive the error "01-04 12:27:46.471: ERROR/AndroidRuntime(1771): Caused by: android.view.InflateException: Binary XML file line #605: Error inflating class android.widget.CompoundButton" After fighting the error for a half an hour I decided to try a minimalistic example. I am using the latest eclipse developer tools, and targeting android 2.2 makign the minimum sdk required 2.2 (8). Here is the activity java code: package com.example.CompoundButtonExample; import android.app.Activity; import android.os.Bundle; public class CompoundButtonExampleActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } } Here is the layout xml code: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> <CompoundButton android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> </LinearLayout> Here is the manifest xml code: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.CompoundButtonExample" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".CompoundButtonExampleActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> <uses-sdk android:minSdkVersion="8" /> </manifest> As you can see it is just the default hello world project that eclipse creates for you when you start a new Android project. It only differs in the fact that I add a "CompoundButton" to the main layout in a vertical LinearLayout. Can anyone confirm this bug? Or tell me what I am doing wrong?

    Read the article

  • Easiest way to implement RSS reader on Google Android?

    - by user291888
    Hi guys, This is my first time on stack overflow, so I apologize if this question has been asked before, but is there an easy way to implement an RSS reader on the Google Android (API 1.5)? I'm searched far and wide with the code sources I know of, and I've only found one implementation which takes 6 different classes and doesn't seem to compile on the current Android SDK's. If I end up having to write my own, I'll be sure to post it here later on. Thanks a lot.

    Read the article

  • android ImageView scaling to fit another View

    - by Nick
    I have a relative layout that comprises a TextView and an ImageView: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true"/> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:adjustViewBounds="true"/> </RelativeLayout> It looks as follows: What I want to achieve is: It means that I want my ImageView to scale to fit the TextView by height. Can it be done in xml, without java-coding? If I could write something like android:layout_height="match_that_TextView" it would have solved this issue, but it's impossible I guess.

    Read the article

  • How to pass the values from one activity to previous activity

    - by Kumar
    Dear friends.. Can any one tell me how to pass the value from one screen to its previous screen. Consider the case.i m having two screen first screen with one Textview and button and the second activity have one edittext and button. If i click the first button then it has to move to second activity and here user has to type something in the textbox. If he press the button from the second screen then the values from the textbox should move to the first activity and that should be displayed in the first activity textview. regards, s.kumaran.

    Read the article

  • How do I style buttons in a LinearLayout like a ListView

    - by Mannaz
    I have a vertically orientated LinearLayout with some Buttons in it: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <Button android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@+id/bt1" android:text="Button 1"></Button> <Button android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@+id/bt2" android:text="Button 2"></Button> <Button android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@+id/bt3" android:text="Button 3"></Button> <Button android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@+id/bt4" android:text="Button 4"></Button> </LinearLayout> and I want this "List" of buttons to inherit the current style for ListView items. This is my current status of the stylesheet. The CKButton style gets applied over the Activity Theme. <style name="CKButton" parent="android:style/Widget.Button"> <item name="android:textSize">21sp</item> <item name="android:layout_margin">0dip</item> <!--<item name="android:background">@drawable/button_background</item>--> <item name="android:textColor">@color/button_text_normal</item> <item name="android:padding">10dip</item> <item name="android:gravity">left|center_horizontal</item> </style> As you see I tried to draw the button background myself, but depending on the system default theme the background-color changes and therefore defining a static color is not an option. Is there a way to inherit the default ListView Row background within that buttons?

    Read the article

  • Start Activity with an animation

    - by adityad
    I am trying to start an activity with a custom transition animation. The only way I have found out so far to do this (without using onPendingTransition() in the previous activity) is to use a custom theme on the activity and define either activityOpenEnterAnimation, taskOpenEnterAnimation, windowEnterAnimation or windowAnimationStyle to set the animation. But, none of these attributes are working for me. Some experimentation yielded the following results- If I set the windowAnimationStyle attribute to some custom style which defines values for activityOpenEnterAnimation, taskOpenEnterAnimation, windowEnterAnimation or windowAnimationStyle I can get rid of the default transition animation occurring at the start of the activity. It doesn't show the transition animation using the actual value specified but at least the default animation is not shown. According to the reference doc here, http://developer.android.com/reference/android/R.attr.html I should be able to define an animation at the start of the activity using activityOpenEnterAnimation. But no success so far. Any ideas?

    Read the article

  • passing data from an activity to an listactivity or listview

    - by wicked14
    need help on passing data from an activity to an listactivity or listview for an android app. im having problems on passing data to a listview. what the app do is from addact class the user can input things to do and in the viewact class this will display the activies add by the user in listview public class addact extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.newact); Button btn1 = (Button)findViewById(R.id.btnsave); final EditText et1 = (EditText)findViewById(R.id.etactivity); btn1.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { Intent it = new Intent(addact.this, viewact.class); it.putExtra("thekey", et1.getText().toString()); startActivity(it); } }); } } public class viewact extends ListActivity { String addToDo =getIntent().getExtras().getString("thekey"); String[] toDoAct = new String[] {addToDo }; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.viewact); setListAdapter(new ArrayAdapter<String>(this, R.layout.viewact,toDoAct)); ListView listView = getListView(); listView.setTextFilterEnabled(true); listView.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { for (int i=0; i < 2; i++) { Toast.makeText(getApplicationContext(), ((TextView) view).getText(), Toast.LENGTH_LONG).show(); } } }); } }

    Read the article

  • Issues with start activity for result

    - by rodkarom
    I have written an Activity using Theme.Holo.Dialog so that it works as an AlertDialog as a login/password notice. I've started this activity with startActivityForResult(...) using a request code I defined. The thing is, whenever I start the activity ´onActivityResult(...)´ is triggered immediately, the buttons get loaded and everything, but once I press them, even though I know the Activity is working because login does happen, there is no result sent back to the first Activity and I am calling setResult(...) and finish() after the buttons are pressed. Thanks in advance, first time using startActivityForResult so I'm sure I must be missing something.

    Read the article

  • Fixed footer not displaying the bottom-most list item

    - by Mohit Deshpande
    Here is my XML layout: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ListView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/list" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"> </ListView> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_alignParentBottom="true"> <EditText xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_weight="1" /> <Button xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_weight="2" /> </LinearLayout> </RelativeLayout> Which causes this problem: The listview item (outlined in red) is behind the fixed footer and cannot be used. Any solutions?

    Read the article

  • Sqlite Database LEAK FOUND exception in android?

    - by androidbase
    hi all, i am getting this exception in database Leak Found my LOGCAT Shows this: 02-17 17:20:37.857: INFO/ActivityManager(58): Starting activity: Intent { cmp=com.example.brown/.Bru_Bears_Womens_View (has extras) } 02-17 17:20:38.477: DEBUG/dalvikvm(434): GC freed 1086 objects / 63888 bytes in 119ms 02-17 17:20:38.556: ERROR/Database(434): Leak found 02-17 17:20:38.556: ERROR/Database(434): java.lang.IllegalStateException: /data/data/com.example.brown/databases/BRUNEWS_DB_01.db SQLiteDatabase created and never closed 02-17 17:20:38.556: ERROR/Database(434): at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1694) 02-17 17:20:38.556: ERROR/Database(434): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:738) 02-17 17:20:38.556: ERROR/Database(434): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:760) 02-17 17:20:38.556: ERROR/Database(434): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:753) 02-17 17:20:38.556: ERROR/Database(434): at android.app.ApplicationContext.openOrCreateDatabase(ApplicationContext.java:473) 02-17 17:20:38.556: ERROR/Database(434): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:193) 02-17 17:20:38.556: ERROR/Database(434): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98) 02-17 17:20:38.556: ERROR/Database(434): at com.example.brown.Brown_Splash.onCreate(Brown_Splash.java:52) 02-17 17:20:38.556: ERROR/Database(434): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 02-17 17:20:38.556: ERROR/Database(434): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459) 02-17 17:20:38.556: ERROR/Database(434): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512) 02-17 17:20:38.556: ERROR/Database(434): at android.app.ActivityThread.access$2200(ActivityThread.java:119) 02-17 17:20:38.556: ERROR/Database(434): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863) 02-17 17:20:38.556: ERROR/Database(434): at android.os.Handler.dispatchMessage(Handler.java:99) 02-17 17:20:38.556: ERROR/Database(434): at android.os.Looper.loop(Looper.java:123) 02-17 17:20:38.556: ERROR/Database(434): at android.app.ActivityThread.main(ActivityThread.java:4363) 02-17 17:20:38.556: ERROR/Database(434): at java.lang.reflect.Method.invokeNative(Native Method) 02-17 17:20:38.556: ERROR/Database(434): at java.lang.reflect.Method.invoke(Method.java:521) 02-17 17:20:38.556: ERROR/Database(434): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 02-17 17:20:38.556: ERROR/Database(434): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 02-17 17:20:38.556: ERROR/Database(434): at dalvik.system.NativeStart.main(Native Method) how can i solve it??? thanks in advance...

    Read the article

  • Android Application is unexpectedly stopped error when button is clicked

    - by user1794499
    Hi there I'm totally new to Android development and I'm working in my android application my application includes a forum where users can post, comment and have their discussion there.... So I'm working in the interface but I get error when I click on the button I directs me to the signup page can somebody please help me with this error this is the code of the mainuserinterface.java for the mainuserinterface.xml file where the button resides. and the signupform.class is the java file for the next activity triggered when the button is clicked the error I receive is the application is unexpectedly stopped.. Hope I make it clear for you guys package com.mohammed.watzIslam; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; public class mainuserinterface extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.mainuserinterface); // this is the button where I receive errors when I click Button forum = (Button) findViewById(R.id.next); forum.setOnClickListener(new View.OnClickListener() { public void onClick(View view){ Intent myIntent = new Intent (view.getContext(), signupform.class); startActivityForResult (myIntent, 0); } }); //these two button still not directing to any next activity yet Button button1 = (Button) findViewById(R.id.next); forum.setOnClickListener(new View.OnClickListener() { public void onClick(View view){ Intent myIntent1 = new Intent (view.getContext(), signupform.class); startActivityForResult (myIntent1, 0); } }); Button button2 = (Button) findViewById(R.id.next); forum.setOnClickListener(new View.OnClickListener() { public void onClick(View view){ Intent myIntent2 = new Intent (view.getContext(), signupform.class); startActivityForResult (myIntent2, 0); } }); } }

    Read the article

  • Android AppWidget maps activity problem

    - by Andy Armstrong
    Right. So I have an app widget. It has 4 buttons, one one of the buttons I want it to show me the current location of the user on the map. So - I make a new activity as below: package com.android.driverwidget; import java.util.List; import android.os.Bundle; import com.google.android.maps.MapActivity; import com.google.android.maps.MapController; import com.google.android.maps.MapView; import com.google.android.maps.MyLocationOverlay; import com.google.android.maps.Overlay; public class MyLocation extends MapActivity{ public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); MapView myMapView = (MapView)findViewById(R.id.mapview); MapController mapController = myMapView.getController(); List<Overlay> overlays = myMapView.getOverlays(); MyLocationOverlay myLocationOverlay = new MyLocationOverlay(this, myMapView); overlays.add(myLocationOverlay); myLocationOverlay.enableMyLocation(); } protected boolean isRouteDisplayed() { return false; } } And then I added the appropriate uses library line to the manifest <activity android:name=".MyLocation" android:label="myLocation"> </activity> <uses-library android:name="com.google.android.maps" /> Ok yet - when I run the app the following errors occur, looks like it cannot find the MapActivity class, im running it on the GoogleApps 1.5 instead of normal android 1.5 as well. http://pastebin.com/m3ee8dba2 Somebody plz help me - i am now dying.

    Read the article

  • Android app in eclipse

    - by Colin
    Hello everybody, i've searched for days but cant find an answer, perhaps you guys can help. I'm creating an android app in eclipse, it all works just one thing is bugging me. this is my main.java: package com.test; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Toast; public class Main extends Activity implements OnClickListener { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // Add Click listeners for all buttons View firstButton = findViewById(R.id.btn_rassen); firstButton.setOnClickListener(this); View secondButton = findViewById(R.id.button2); secondButton.setOnClickListener(this); } // Process the button click events @Override public void onClick(View v) { switch(v.getId()){ case R.id.btn_rassen: Intent j = new Intent(this, Webscreen.class); j.putExtra(com.test.Webscreen.URL, "http://www.google.com/"); startActivity(j); break; case R.id.button2: Intent k = new Intent(this, Webscreen.class); k.putExtra(com.test.Webscreen.URL, "http://notworkingurltotest.com"); startActivity(k); break; } } } now when it calls the webview.java the page called shows up but not the buttons i created in the layout xml page. does anybody have any idea why this is? your help is much appreciated! ohw this is my webscreen.java package com.test; import android.app.Activity; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.view.Window; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Toast; public class Webscreen extends Activity { public static final String URL = ""; private static final String TAG = "WebscreenClass"; private WebView webview; private ProgressDialog progressDialog; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.webscreen); this.getIntent().getExtras(); this.webview = (WebView) findViewById(R.string.webview); String turl = getIntent().getStringExtra(URL); Log.i(TAG, " URL = "+turl); WebView webview = new WebView(this); setContentView(webview); final Activity activity = this; webview.setWebViewClient(new WebViewClient() { public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } public void onLoadResource (WebView view, String url) { if (progressDialog == null) { progressDialog = new ProgressDialog(activity); progressDialog.setMessage("Bezig met laden..."); progressDialog.show(); } } public void onPageFinished(WebView view, String url) { if (progressDialog.isShowing()) { progressDialog.dismiss(); progressDialog = null; } } public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Intent myIntent = new Intent(); myIntent.setClassName("com.test", "com.test.Main"); startActivity(myIntent); Toast.makeText(activity, "Laden van onderdeel mislukt, probeer het later nog eens! ", Toast.LENGTH_LONG).show(); progressDialog.show(); } }); webview.loadUrl(turl); } } webscreen.xml layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <!-- <1> --> <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/url" android:layout_height="wrap_content" android:layout_width="wrap_content" android:lines="1" android:layout_weight="1.0" android:hint="http://" android:visibility="visible" /> <Button android:id="@+id/go_button" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="go_button" /> </LinearLayout> <!-- <2> --> <WebView android:id="@string/webview" android:layout_width="fill_parent" android:layout_height="0dip" /> </LinearLayout>

    Read the article

  • Show MapView on PopupWindow

    - by Ali Nadi
    I want to show MapView on PopupWindow and get error when press-on Map. Please help! Liste.java MapView mapView; View view; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.liste); LayoutInflater mInflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE); view = mInflater.inflate(R.layout.pop_up, (ViewGroup) findViewById(R.id.popup_element), false); mapView = (MapView) view.findViewById(R.id.mapview_popup); listView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View v, int position, long id) { initiatePopupWindow(earthQuakeList.get(position)); } }); } private void initiatePopupWindow(EqData data) { try { mapView.setBuiltInZoomControls(true); List<Overlay> mapOverlays = mapView.getOverlays(); Drawable marker = this.getResources().getDrawable(R.drawable.marker1); HaritaOverlay itemizedoverlay = new HaritaOverlay(marker, this); Coordination coord = data.getCoordination(); GeoPoint point = new GeoPoint( (int)coord.latitude, (int)coord.longitude); OverlayItem overlayitem = new OverlayItem(point, data.lokasyon, data.name); itemizedoverlay.addOverlay(overlayitem); mapOverlays.add(itemizedoverlay); Display display = getWindowManager().getDefaultDisplay(); pw = new PopupWindow(view, display.getWidth(), display.getHeight()/2, true); // display the popup in the center pw.showAtLocation(view, Gravity.CENTER, 0, display.getHeight()/2); } catch (Exception e) { e.printStackTrace(); } } pop_up.xml <?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" android:baselineAligned="false" android:orientation="vertical" android:weightSum="540" android:id="@+id/popup_element" > ... <LinearLayout android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="440" > <com.google.android.maps.MapView android:id="@+id/mapview_popup" android:layout_width="fill_parent" android:layout_height="fill_parent" android:apiKey="@string/ApiMapKey" android:clickable="true" /> </LinearLayout> Error 07-23 17:36:28.820: E/MapActivity(12413): Couldn't get connection factory client 07-23 17:36:37.760: E/AndroidRuntime(12413): FATAL EXCEPTION: main 07-23 17:36:37.760: E/AndroidRuntime(12413): android.view.WindowManager$BadTokenException: Unable to add window -- token android.view.ViewRoot$W@40590b70 is not valid; is your activity running? 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.ViewRoot.setView(ViewRoot.java:528) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.Window$LocalWindowManager.addView(Window.java:465) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.widget.ZoomButtonsController.setVisible(ZoomButtonsController.java:370) 07-23 17:36:37.760: E/AndroidRuntime(12413): at com.google.android.maps.MapView.displayZoomControls(MapView.java:1053) 07-23 17:36:37.760: E/AndroidRuntime(12413): at com.google.android.maps.MapView$1.onDown(MapView.java:341) 07-23 17:36:37.760: E/AndroidRuntime(12413): at com.google.android.maps.GestureDetector.onTouchEvent(GestureDetector.java:488) 07-23 17:36:37.760: E/AndroidRuntime(12413): at com.google.android.maps.MapView.onTouchEvent(MapView.java:683) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.View.dispatchTouchEvent(View.java:3901) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2200) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.ViewRoot.handleMessage(ViewRoot.java:1884) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.os.Handler.dispatchMessage(Handler.java:99) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.os.Looper.loop(Looper.java:130) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.app.ActivityThread.main(ActivityThread.java:3835) 07-23 17:36:37.760: E/AndroidRuntime(12413): at java.lang.reflect.Method.invokeNative(Native Method) 07-23 17:36:37.760: E/AndroidRuntime(12413): at java.lang.reflect.Method.invoke(Method.java:507) 07-23 17:36:37.760: E/AndroidRuntime(12413): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847) 07-23 17:36:37.760: E/AndroidRuntime(12413): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605) 07-23 17:36:37.760: E/AndroidRuntime(12413): at dalvik.system.NativeStart.main(Native Method)

    Read the article

  • Compiler can not find AndroidInstrumentationTestCase2 when building Android app test code with Andro

    - by orospakr
    I have a project with some Android test code in it (with the appropriate elements, <uses-library> and <instrumentation>, added to AndroidManifest.xml). This works fine in Eclipse. However, it fails to build with mm, claiming that it can't find the test-runner classes: /home/orospakr/code/my-android/packages/apps/MyApp/src/ca/orospakr/myapp/test/functional/MyActivityTest.java:5: cannot find symbol symbol : class ActivityInstrumentationTestCase2 location: package android.test import android.test.ActivityInstrumentationTestCase2; ^

    Read the article

  • Android App to call a number on button click

    - by FosterZ
    hey guys this is my 1st android app(learning), so i want to call a number given in the textbox but i'm getting error as "The application 'xyz'(process com.adroid) has stoped unexpectedly".. following the code i have done so far... where m doing wrong ?? EditText txtPhn; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button callButton = (Button)findViewById(R.id.btnCall); txtPhn = (EditText)findViewById(R.id.txtPhnNumber); callButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { try { Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri.parse("tel:"+txtPhn.getText().toString())); startActivity(callIntent); } catch (ActivityNotFoundException activityException) { Log.e("Calling a Phone Number", "Call failed", activityException); } } }); } EDITED LogCat 03-09 11:23:25.874: ERROR/AndroidRuntime(370): FATAL EXCEPTION: main 03-09 11:23:25.874: ERROR/AndroidRuntime(370): java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.CALL dat=tel:xxx-xxx-xxxx flg=0x10000000 cmp=com.android.phone/.OutgoingCallBroadcaster } from ProcessRecord{40738d70 370:org.krish.android/10034} (pid=370, uid=10034) requires android.permission.CALL_PHONE 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.os.Parcel.readException(Parcel.java:1322) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.os.Parcel.readException(Parcel.java:1276) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1351) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1374) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.app.Activity.startActivityForResult(Activity.java:2827) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.app.Activity.startActivity(Activity.java:2933) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at org.krish.android.caller$1.onClick(caller.java:29) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.view.View.performClick(View.java:2485) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.view.View$PerformClick.run(View.java:9080) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.os.Handler.handleCallback(Handler.java:587) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.os.Handler.dispatchMessage(Handler.java:92) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.os.Looper.loop(Looper.java:123) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.app.ActivityThread.main(ActivityThread.java:3683) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at java.lang.reflect.Method.invokeNative(Native Method) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at java.lang.reflect.Method.invoke(Method.java:507) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 03-09 11:23:25.874: ERROR/AndroidRuntime(370): at dalvik.system.NativeStart.main(Native Method)

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >