Search Results

Search found 3983 results on 160 pages for 'activity'.

Page 11/160 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • ActivityGroup start 3rd party Activity.

    - by MrSnowflake
    Hi guys, I'm trying to make an ActivityGroup which has it's own interface, which should be persistent between Activities. I have it working for my own Activities. But when I try to launch a 3rd party activity (from it's Intent{action="ACTION_HOME", category="CATEGORY_LAUNCHER"}) I get a java.lang.SecurityException because the Activity I want to start does not have the same UID as the calling Activity. Does anyone knows how to cirumvent this?

    Read the article

  • Can't find method in the activity

    - by Synesso
    I'm starting with Scala + Android. I'm trying to wire a button action to a button without the activity implementing View.OnClickListener. The button click fails at runtime because the method cannot be found. The document I'm working through says that I need only declare a public void method taking a View on the action, and use that method name in the layout. What have I done wrong? MainActivity.scala package net.badgerhunt.hwa import android.app.Activity import android.os.Bundle import android.widget.Button import android.view.View import java.util.Date class MainActivity extends Activity { override def onCreate(savedInstanceState: Bundle) = { super.onCreate(savedInstanceState) setContentView(R.layout.main) } def calculate(button: View): Unit = println("calculating with %s ...".format(button)) } res/layout/main.xml <?xml version="1.0" encoding="utf-8"?> <Button xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/button" android:text="" android:onClick="calculate" android:layout_width="fill_parent" android:layout_height="fill_parent"/> the failure onclick D/AndroidRuntime( 362): Shutting down VM W/dalvikvm( 362): threadid=3: thread exiting with uncaught exception (group=0x4001b188) E/AndroidRuntime( 362): Uncaught handler: thread main exiting due to uncaught exception E/AndroidRuntime( 362): java.lang.IllegalStateException: Could not find a method calculate(View) in the activity E/AndroidRuntime( 362): at android.view.View$1.onClick(View.java:2020) E/AndroidRuntime( 362): at android.view.View.performClick(View.java:2364) E/AndroidRuntime( 362): at android.view.View.onTouchEvent(View.java:4179) E/AndroidRuntime( 362): at android.widget.TextView.onTouchEvent(TextView.java:6540) E/AndroidRuntime( 362): at android.view.View.dispatchTouchEvent(View.java:3709) E/AndroidRuntime( 362): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) E/AndroidRuntime( 362): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) E/AndroidRuntime( 362): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) E/AndroidRuntime( 362): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659) E/AndroidRuntime( 362): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107) E/AndroidRuntime( 362): at android.app.Activity.dispatchTouchEvent(Activity.java:2061) E/AndroidRuntime( 362): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643) E/AndroidRuntime( 362): at android.view.ViewRoot.handleMessage(ViewRoot.java:1691) E/AndroidRuntime( 362): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 362): at android.os.Looper.loop(Looper.java:123) E/AndroidRuntime( 362): at android.app.ActivityThread.main(ActivityThread.java:4363) E/AndroidRuntime( 362): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 362): at java.lang.reflect.Method.invoke(Method.java:521) E/AndroidRuntime( 362): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) E/AndroidRuntime( 362): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) E/AndroidRuntime( 362): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 362): Caused by: java.lang.NoSuchMethodException: calculate E/AndroidRuntime( 362): at java.lang.ClassCache.findMethodByName(ClassCache.java:308) E/AndroidRuntime( 362): at java.lang.Class.getMethod(Class.java:1014) E/AndroidRuntime( 362): at android.view.View$1.onClick(View.java:2017) E/AndroidRuntime( 362): ... 20 more

    Read the article

  • Android launches system settings instead of my app

    - by jsundin
    Hi, For some reason whenever I (try to) start my app the phone decides to launch system settings instead of my "main activity". And yes, I am referring to the "Android system settings", and not something from my app. This only happens on my phone, and I suppose it probably could be related to the fact that my app had just opened system settings when I decided to re-launch with a new version from Eclipse. It is possible to start the app from within Eclipse, but when I navigate back from the app it returns to the system settings rather than the home screen, as if the settings activity was started first and then my activity. If I then start the app from the phone all I get is system settings yet again. The app is listening to the VIEW-action for a specific URL substring, and when I start the app using a matching URL I get the same result as when I start it from Eclipse, app starts, but when I return I return to settings. I have tried googling for this problem, and all I could find was something about Android saving state when an app gets killed, but without any information on how to reset this state. I have tried uninstalling the app, killing system settings, rebooting the phone, reinstalling, clearing application data.. no luck.. For what it's worth, here's the definition of my main activity from the manifest, <activity android:name=".HomeActivity" android:label="@string/app_name" android:screenOrientation="portrait" android:clearTaskOnLaunch="true" android:launchMode="singleTop"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW"></action> <category android:name="android.intent.category.DEFAULT"></category> <category android:name="android.intent.category.BROWSABLE"></category> <data android:pathPrefix="/isak-web-mobile/smart/" android:scheme="http" android:host="*"></data> </intent-filter> </activity> And here is the logcat-line from when I try to start my app, nothing about any settings anywhere. I/ActivityManager( 1301): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=se.opencare.isak/.HomeActivity } When I launch from Eclipse I also get this line (as one would expect), I/ActivityManager( 1301): Start proc se.opencare.isak for activity se.opencare.isak/.HomeActivity: pid=23068 uid=10163 gids={3003, 1007, 1015} If it matters the phone is a HTC Desire Z running 2.2.1. Currently, this is my HomeActivity, public class HomeActivity extends Activity { public static final String TAG = "HomeActivity"; @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { Log.d(TAG, "onActivityResult(" + requestCode + ", " + resultCode + ", " + data + ")"); super.onActivityResult(requestCode, resultCode, data); } @Override protected void onCreate(Bundle savedInstanceState) { Log.d(TAG, "onCreate(" + savedInstanceState + ")"); super.onCreate(savedInstanceState); } @Override protected void onDestroy() { Log.d(TAG, "onDestroy()"); super.onDestroy(); } @Override protected void onPause() { Log.d(TAG, "onPause()"); super.onPause(); } @Override protected void onPostCreate(Bundle savedInstanceState) { Log.d(TAG, "onPostCreate(" + savedInstanceState + ")"); super.onPostCreate(savedInstanceState); } @Override protected void onPostResume() { Log.d(TAG, "onPostResume()"); super.onPostResume(); } @Override protected void onRestart() { Log.d(TAG, "onRestart()"); super.onRestart(); } @Override protected void onRestoreInstanceState(Bundle savedInstanceState) { Log.d(TAG, "onRestoreInstanceState(" + savedInstanceState + ")"); super.onRestoreInstanceState(savedInstanceState); } @Override protected void onResume() { Log.d(TAG, "onResume()"); super.onResume(); } @Override protected void onStart() { Log.d(TAG, "onStart()"); super.onStart(); } @Override protected void onStop() { Log.d(TAG, "onStop()"); super.onStop(); } @Override protected void onUserLeaveHint() { Log.d(TAG, "onUserLeaveHint()"); super.onUserLeaveHint(); } } Nothing (of the above) is written to the log.

    Read the article

  • Exception when creating an activity: Could not select item Parcel unable to marshal value

    - by user341652
    Hi, I am trying to call an Activity from another instance of the activity. The code is supposed to be a simple file browser (part of a larger application). I am using a ListActivity, and when an item (such as a folder) is selected, it is supposed to open it up in the new Activity. I have a feeling it is a problem with the AndroidManifest (which just has the basic tag). Any assistance would be appreciated. Thanks, Steve

    Read the article

  • Android problem with opening a second activity and fails to launch

    - by Capsud
    Hi there, Bear with me as i'm just learning about Android. What i'm trying to do is to open an Activity when i click on a button. This is my code in my main activity public class MainPage extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button restaurants = (Button) findViewById(R.id.widget88); restaurants.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { Intent myIntent = new Intent(view.getContext(), AZRestaurants.class); startActivityForResult(myIntent, 0); } }); //Button location = (Button) findViewById(R.id.location); //location.setOnClickListener(new View.OnClickListener() { //public void onClick(View view) { // Intent myIntent = new Intent(view.getContext(), Location.class); // startActivity(myIntent); //} // }); } The program launches no problem when i just implement the first button (restuarant). But when i try to implement the button that i have commented out it fails to launch. and yes i have added the activity to the manifest file. Can anyone help me please? Thanks.

    Read the article

  • Android 2.1: Muliple Handlers in a Single Activity

    - by Soumya Simanta
    Hi, I've more than one Handlers in an Activity. I create all the handlers in the onCreate() of the main activity. My understanding is the handlerMessage() method of each handler will never be called at the same time because all messages are put in the same queue (the Activity thread MessageQueue). Therefore, they will be executed in the order in which are put into the Queue. They will also be executed in the main activity thread. Is this correct ? public void onCreate() { this.handler1 = new Handler() { @Override public void handleMessage(Message msg) { //operation 1 : some operation with instanceVariable1 super.handleMessage(msg); } }; this.handler2 = new Handler() { @Override public void handleMessage(Message msg) { //Operation 2: some operation with instanceVariable1 super.handleMessage(msg); } }; this.handler3 = new Handler() { @Override public void handleMessage(Message msg) { //Operation 3: some operation with instanceVariable1 super.handleMessage(msg); } }; }

    Read the article

  • Activity should be transparent, but has black background

    - by Uwe Krass
    I followed the instructions of writing a transparent layout. My res/values/style.xml looks like this: <resources> <style name="Theme" parent="android:Theme" /> <style name="Theme.Transparent"> <item name="android:windowBackground">@drawable/transparent_background</item> </style> <drawable name="transparent_background">#00000000</drawable> </resources> The activity snippet looks like this: <activity android:name=".Controlls" android:label="Controlls" android:theme="@style/Theme.Transparent"> When I start this activity from my root activity, the layout gets drawn correctly, but the background stays black.

    Read the article

  • Google App Engine - How to implement the activity stream in a social network

    - by spidee
    I want some ideas on the best practice to implement an activity stream for a social network im building in app engine (PYTHON) I first want to keep a log for all activities of each user - so that we have a history. i.e. someone became a friend, added a picture, changed their address etc. This way we have a users history available should we need it. Also mean we can remove friendship joins, change user data but have a historical log. I also want to stream a users activity to their friends. for this only the last X activities need to be kept - that is in the scenario that messages are sent to friends when an activity occurs. Its pretty straight forward designing a history log - ie: when, what, where. The complication comes as to how we notify friends of a user as to their activity. In our app friendships are not mutual - ie they are based on the twitter following model. Some accounts could have thousands of followers. What is the best approach to model this. using a many to many join table and doing a costly query - using a feed class that fired a copy of the activity to all the subscribers - maybe into mcache? As their maybe a need to fire thousands of messages i would imagine a cron job would need to be used. Any help ideas thoughts on this Thx

    Read the article

  • How can I bring an activity to the front from a background service

    - by Erwan Pinault
    Hi, First of all, I am aware my issue is against the philosophy of Android, but I have no choice, this application will run on a embedded car gps and I need to bring an activity to prevent from car accident, for example, when it's happen around the user. I have to put other activity on the back and bring my alert pop up without user manipulation like notification on the front. Is there a way to bring manually an activity to the front, by resuming it like when you click on the android task switcher?

    Read the article

  • handling activity destruction in multithreaded android app

    - by Jayesh
    Hi, I have a multithreded app where background threads are used to load data over network or from disk/db. Every once in a while user will perform some action e.g. fetch news over network, which will spawn a background AsyncTask, but for some reason user will quit the app (press back button so that activity gets destroyed). In most such scenarios, I make appropriate checks in the background thread after it returns from n/w i/o, so that it won't crash by accessing members of the activity that is destroyed by now. However some corner cases are left where crashes happen, because the background thread would access some member of activity that is now null. Do other Android developers have some generic/recommended framework to handle such scenarios? These are the times when I wish android would have guaranteed termination of all threads when activity destroys (in the same way that regular linux process cleans up when it's quit)... but I guess Android devs had good reasons for not exposing process lifetimes through the api.

    Read the article

  • How to show a ProgressDialog while changing from a activity to another activity?

    - by AndroidUser99
    i want to show a PD when my activity A starts another activity B. But in that onclick method, my A activity haves to do some work before start B, and B also haves to do some work because it haves to load a lot of data for the UI. I need a PD that is viewed by the user in all the process of the loading data of changin from activity A to B. ¿how can do it? i tryed storing a static ProgressDialog on MyApplication.java, and with these methods: public static void showProgressDialog(Context c) { pd = ProgressDialog.show(c, c.getResources().getString(R.string.app_name), c.getResources().getString(R.string.loading), true, false); } public static void dismissProgressDialog(){ pd.dismiss(); } but it doesn't works, it doesn't shows nothing, i dont know why how to achieve this by a easy way? i know that i can do it with async task, but that is too hard for me, i can't understand the code examples i am finding on this web and google code examples are welcome thanks

    Read the article

  • Android ListView in Activity getting Refreshed on Changing Orientation

    - by y ramesh rao
    I have Activity with ListView inside it and in the onCreate method of the Activity I have code for populating the Data of the ListView this Data is a server based and so populating includes calling Network URLs. I have the ArrayAdapter of the ListView in the Same Activity Class. Now the Issue I'am facing is that, in Rest all scenarios my Activity is behaving in a proper way but when the Orientation [ Portrait to Landscaped or other way round] is taking place the Data is Getting lost and Newer Data calls are Required to Populate the Same Old Data now this is something that is not intended out the code how should I deal with it.

    Read the article

  • How to show virtual keypad in an android activity

    - by Maxood
    Why am i not able to show the virtual keyboard in my activity. Here is my code: package som.android.keypad; import android.app.Activity; import android.os.Bundle; import android.view.inputmethod.InputMethodManager; import android.widget.EditText; public class ShowKeypad extends Activity { InputMethodManager imm; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); EditText editText = (EditText)findViewById(R.id.EditText); ((InputMethodManager) getSystemService(this.INPUT_METHOD_SERVICE)).showSoftInput(editText, 0); } } <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="som.android.keypad" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".ShowKeypad" android:windowSoftInputMode="stateAlwaysVisible" 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="4" /> </manifest>

    Read the article

  • Switch back to previously selected tab after the activity is recreated

    - by ZelluX
    In my TabActivity the user may be asked to switch to browser activity for OAuth phase, and if the phase takes too much time, my activity will be killed. After the user switches back to my activity, its onCreate() method is invoked again and tabs are recreated. So I would like to know if there is any simple way to switch back to previous tab, and keep the tab as what it was. For example, one of the tab views contains a ViewSwitcher child, and I want to switch back to the switched view after recreating the activity.

    Read the article

  • Sync between local service with a thread and an activity

    - by Henrik
    Hello all, I'm trying to think of a way on how to sync in between a local service and the main activity. The local service has, A thread with a socket connection that could receive data at any time. A list/array with data. At any time the socket could receive data and add it to the list. The activity needs to display this data. So when the activity starts up it needs to attach or start the local service and fetch the list. It also needs to be notified if the list is updated. I think I would need to sync my list somehow so the local service does not add a new entry to it while the activity fetches the list when connecting to the service. Any ideas? Thanks.

    Read the article

  • Android moving back to first activity on button click

    - by cppdev
    I am writing a application where I am dealing with 4 activities, let's say A, B, C & D. Activity A invokes B, B invokes C, C invokes D. On each of the activity, I have a button called "home" button. When user clicks on home button in any of the B, C, D activities, application should go back to A activity screen ? How to simulate "home" button in this case ?

    Read the article

  • AsyncTask won't stop even when the activity has destroyed

    - by Raja
    Hi all, I have an AsyncTask object which starts executing when the activity is created and does stuff in the background (downloads upto 100 images). Everything works fine but there is this peculiar behavior which i'm not able to understand. For eg: when the android screen's orientation changes then the activity is destroyed and created again. So I override the onRetainNonConfigurationInstance() method and save all the downloaded data executed in the AsyncTask. My purpose of doing this is to not have AsyncTask run each time activity is destroyed-created during orientation changes, but as i can see in my logs the previous AsynTask is still executing. (The data is saved correctly though) I even tried to cancel the AsynTask in the onDestroy() method of the activity but the logs still show AsynTask as running. This is really strange behavior and would really be thankful if someone can tell me the correct procedure to stop/cancel the AsynTask. Thanks

    Read the article

  • remine focus on the main activity (while switching activities)

    - by rayman
    Hi, Ive got two activities in the same application. the first one is with gui(main activity) the second one is a listener which works infinite without gui. Wierd problem occurs: i am running the second activity with a diffrent thread so i could keep on manipulate the gui.. but for some reason, the gui losing it's focus for some reason, only when i press 'home' and come back to it, then i can continune maniuplate the gui. it feels like after i launch the second activity, the gui activity(the main) is losing the focus. how come? in my mainactivity i have: setContentView(R.layout.main); and its setted as the launcher in the manifest. thanks, ray.

    Read the article

  • Android pass a 2d int array from one activity to another ERROR

    - by user2189001
    ACTIVITY 1: Bundle bundle = new Bundle(); bundle.putSerializable("CustomLevelData", LevelCreator.LCLevelData); Intent i = new Intent(LevelCreatorPopout.this, GameView.class); i.putExtras(bundle); startActivity(i); ACTIVITY 2: LevelData=(int[][]) extras.getSerializable("CustomLevelData"); ERROR: E/AndroidRuntime(16220): FATAL EXCEPTION: main E/AndroidRuntime(16220): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.powerpoint45.maze/com.powerpoint45.maze.GameView}: java.lang.ClassCastException: java.lang.Object[] cannot be cast to int[][] I have searched but found nothing on 2d INT array passing

    Read the article

  • Share data between local service and the hosting activity

    - by Moshik
    Hi, i need to share data between a local service and his hosting activity, i`am using sendBroadcast in order to send data to the hosting activity from the service, but if i want to send data back to the service from the hosting activity? so i though to create static method on the service, and call from the activity, and through it send the parameter, but then i cant do operations like toast inside that static method(which is inside the service).. coz you cant use "myclass.this" inside a static method, i guess there r more limits.. mybe another solution? mybe there is a proper way for this task? thanks, moshik.

    Read the article

  • How to pass Remote Interface (aidl) throughout Activities ?

    - by Spredzy
    Hi All, I am developing an application using services and Remote interface. I have a question about passing the reference of my Remote interface throughout Activities. In my first Activity, I bind my service with my activity, in order to get a reference to my interface I use private ServiceConnection mConnection = new ServiceConnection() { @Override public void onServiceConnected(ComponentName arg0, IBinder service) { x = X.Stub.asInterface(service); } @Override public void onServiceDisconnected(ComponentName arg0) { // TODO Auto-generated method stub } }; x being the reference to my interface. Now I would like to access this interface from another activity, I see two ways to do it but I don't know which one is the "proper" way to do it : passing x with my intent when I call the new Activity redo this.bindService(new Intent(y.this,z.class), mConnection, Context.BIND_AUTO_CREATE); in the onCreate() of my new Activity What would you advice me to do ?

    Read the article

  • android startactivity

    - by mnish
    Hello, I have an application that contains 3 activities A, B and C. The activity A is the one that gets started when I start my app. From A I start B using startActivity(A.this, B.class), this goes well. What goes wrong is when I want to start the activity C from B. this how the manifestfile looks like: <activity android:name=".B"/> <activity android:name=".C"/> I know that I can do the follwoings: start B from A and then from B go back to A and then start C or let B has its own manifestfile thus a stand lone app, and let C be an activity within this app. Any suggestion is welcome. My apoligies for my bad english. thank you

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >