Android :: Simple Activity Switch Not Working - No Errors

Feb 19, 2010

I have a basic calculator app I'm making. Two activities, the main one and ResultView.

I've made it where I click a button on activity A to go to activity B. The log says activity B is started and "displayed" successfully, the title for the new activity loads, but the body does NOT show. I added a simple Text view with static text.. see the result.xml at the bottom. I also tried inserting information programmatically, but that didn't do.

When I debug the program, I tried putting breakpoints as the activity is called with startActivity() as well as on the first line of the onCreate method within the ResultView class (my activity "B") but the program never hits the second breakpoint. In fact, it looks as if Looper.class is called in the end.

This bit of code is placed in the button handler on acitivity A:

CODE:........

The activity is in the manifest, within the "application" tag:

CODE:....................

If more info is needed, let me know...in short, "HELLO WORLD" does not display at all.

Android :: Simple activity switch not working - No Errors


Android :: Simple ListPreference Is Not Working?

Aug 27, 2010

I'm betting im missing one small thing. I've looked on the developer site and i've read some tutorials and i'm just not seeing what i did wrong. I'm trying to use a ListPreference to decide which sound to play on a button click. I have this at the top:

public String greensound;
Here's my OnClick code:
case R.id.green:
SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(this);
greensound = prefs.getString("greensound", "gsone");
if (greensound == "gsone") {
mSoundManager.playSound(1);
} else if (greensound == "gstwo") {...................

View 3 Replies View Related

Android :: Simple Example Of Changing Screen Brightness For An Activity?

May 30, 2010

There are apparently at least three different techniques for changing screen brightness in the Android OS. Two of them no longer work post-cupcake and the third accepted technique evidently has a bug. I would like to increase screen brightness at the start of a one-view activity then turn the brightness back to the user setting at the end of the activity. No buttons, no second view or second activity. Just a maxed brightness at start and a return to original brightness setting at the end of the activity. The examples of the current technique using WindowManager.LayoutParams that I have located range from 2 lines of code

WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.screenBrightness = 100 / 100.0f;
getWindow().setAttributes(lp);

To several pages of source code and numerous activities. Is there a simple example of maxing the screen brightness at start that someone can provide a link to?

View 1 Replies View Related

Android :: Simple Code I Can Add To OnStop To Stop GPS Activity?

Aug 31, 2010

Just like the title says, Is there a simple line of code I could add to onStop()that will simply stop any gps activity currently going on with my application?

View 1 Replies View Related

Android : Content Provider - Activity.startManagingCursor And Simple Dao

Jun 1, 2010

I am writing simple app that will read callLog content provider transform data and write it to my own table. my app will not show data directly from calllog content provider.

1. now one problem that I have is I cannot limit how much rows query will return (by calling activity.managedQuery) but I assume that Cursor delays access to the db and I can use moveToNext as many times as desired to get few rows from table and the call will be efficient. is that good thinking?? OR am I wrong here? I really dont want to query all rows from table. is there any other way to access calllog??

2. I dont want to implement my own content provider for my app. I will use rawQuery many times and group data so contentprovider's callbacks are not enough for me. more I want my dao to be private to my application so I think there is no need to bother with conentprovider. and If I got this right I also dont need to bother with activity.startManagingCursor as long I query data inside same method call (because I need to deactivate all intermediate Cursor objects anyway)

View 5 Replies View Related

Android :: Simple Frame Animation - Memory Leak Activity

Apr 14, 2010

I am using a simple frame animation and when I exit and reenter my activity the activity is still referenced in memory.

//This is a sample activity I created to simulate the problem public class MemoryLeakActivity extends Activity {
@Override public void onCreate(final Bundle savedInstanceState) super.onCreate(savedInstanceState);
} @Override public boolean onKeyDown(final int keyCode, final KeyEvent event) {
final Intent i = new Intent(MemoryLeakActivity.this, LeakyActivy.class);
startActivity(i); return super.onKeyDown(keyCode, event);
} }

View 3 Replies View Related

Android :: Simple Program - Class Extends Activity At Startup

Oct 1, 2010

I have a simple activity program in android. Basically the class just extends Activity.
But when I start it I get a ClassCastException in the constructor of my class. I don't even have a constructor defined, so it must be in the constructor of the superclass which is Activity. Unfortunately the debugger doesn't give any detailed information on what class it is trying to cast. Here is the stacktrace:

Thread [<1> main] (Suspended (exception RuntimeException))
ActivityThread$PackageInfo.makeApplication(boolean, Instrumentation) line: 649
ActivityThread.handleBindApplication(ActivityThread$AppBindData) line: 4232
ActivityThread.access$3000(ActivityThread, ActivityThread$AppBindData) line: 125
ActivityThread$H.handleMessage(Message) line: 2071
ActivityThread$H(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 123
ActivityThread.main(String[]) line: 4627
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 521
ZygoteInit$MethodAndArgsCaller.run() line: 868
ZygoteInit.main(String[]) line: 626
NativeStart.main(String[]) line: not available [native method]

And when I look into this runtimeexception I get:

detailMessage "Unable to instantiate application com.test.MyApp: java.lang.ClassCastException: com.test.MyApp" (id=830067694464)
The only code is:
package com.test;
import android.app.Activity;
public class MyApp extends Activity {
}

View 3 Replies View Related

Android :: Can't Get SurfaceView Working - Trying To Make A Simple 2D-shooter

Nov 1, 2009

It is way to slow and in the first example it doesnt even move. How do I make a game? With SurfaceView or OpenGL? And should I draw in a separate thread?

CODE:....................

View 2 Replies View Related

Android :: Simple Listview - Consists Of Strings - When Click Opens A New Activity

Jun 21, 2010

I have a very simple listview going on. The list just consists of strings, when you click the string it opens a new activity blah blah. Here's the problem, I enabled settextfilter and while it did filter the list, when you click the result, it always performs the action of the string located at zero, and not the one it is supposed to.

View 2 Replies View Related

Android :: Display A Dialog In Non-Activity - Simple Java - Class By Passing Parameters

Jun 23, 2010

I am trying to display a dialog box in a simple Java class that is called from my main Activity but not successful. Please help me to figure it out.

I am passing the required values as parametrs.

I have two class: class MainActivity extends Activity :: Main *starting point *of Application class ShowMyDialog :: a simple java program In which I *generate an URl* and *display a dialog with WebView*.

I am passing the Acitivity from my MainActivity to this class as a parameter in function.

But I am *unable to call* the onCreateDialog method that I have *defined in the simple java class.

However, If I define the *onCreateDialog method in MainActivity, I am able to display it successfully.

What Should I pass as Parameter to the non Activity class from MainActivity class so that I am able to display the dialog as defined by showdialog method in JAVA class ???*

My steps of source code is as follow:

code:.........................

View 3 Replies View Related

Android :: How To Switch Tab From Within Sub Activity

Feb 17, 2010

I'm currently working on an application, designed around a TabActivity.Tab1 has a button and I would like when the user click it, it switches to Tab2.

View 10 Replies View Related

Android :: How Does An Activity In A Tab Knows It Switch To Another

Sep 22, 2010

In android, I have a TabActivity with 2 tabs and each tab has it own activity (say ActivityA and ActivityB). When I am on ActivityA, and I click on ActivityB's tab, how does the ActivityA knows it is no longer the active Tab?

View 1 Replies View Related

Android :: Switch Tabs From Within An Activity Within A Tab

Mar 29, 2010

Currently I have a TabHost implemented with 3 tabs each containing a separate activity. My question is how do I switch between tabs from within one of the activities that is located inside the tab host. I've looked everywhere and have been unsuccessful in finding a real answer to this problem.

View 4 Replies View Related

Android :: How Do You Switch Activity Programatically?

Aug 28, 2010

It seems like every example I can find of switching between Activity's involves creating an Intent and passing in the context of a View via an OnClickListener associated with a button.But what if you just decide you need to switch Activity's? In my case, a Preference value is causing an Activity switch. How do you create an Intent that can cause an Activity switch without an associated OnClickListener?

View 4 Replies View Related

Android :: How To Switch From Activity To ListActivity?

Jul 24, 2010

This post probably shows my ignorance of Android coding, but here goes. I have a sample app I am developing which starts by extending Activity. I have a main.XML layout which works great. On a button click from the main layout I'd like to load a ListView. I think I understand how to use ListView and seed data into it. I have created a new layout which contains this ListView. I am confused, however, how I switch from a regular Activity to a ListActivity so I get the convenience methods like setListAdapter()? Should I be starting with a ListView, and then drawing the other view on top once the app starts by inflating the layout and using it? If not, how do I create a ListActivity object inside my app, and where should I create that? If you have a sample application or tutorial that shows how to do this, I would appreciate it.

View 2 Replies View Related

Android :: Way To Switch From Activity To ListActivity?

Jan 22, 2009

I have a main class derived from Activity, I need a ListActivity (displayed when the "menu" button is clicked). How can I proceed. I don't understand how I can switch from one to the other?

View 3 Replies View Related

HTC Droid Eris :: 2.1 V3 Leak Errors / Volume Controls Not Working

May 9, 2010

I am currently running the leaked version of 2.1 from way back.I am now trying to install 2.1 v3.I have followed all the instructions, but when I turn my phone of, the hold vol down and end keys, nothing happens.It begins unzip, then stops, and just sits on the menu screen.Any ideas?

View 2 Replies View Related

Simple SQLite Insertion Operation Not Working?

Apr 17, 2014

I am not able to insert entries in the database. For the record, this was working previously, but I went a few weeks without working with it and now it just doesn't work anymore.

Here is the code where I insert the new row:

Code:
//this is the code where I try to insert the data
dbAdapter.open();
dbAdapter.EnterCreateHistory(DatabaseAdapter.WALKER_HISTORY_TABLE, "fdfsf", "fdfsf1", "fdfsf", "fdfsf", "fdfsf");

[Code]....

The thing is, I am not getting any exceptions or anything. It's just that my number of inserted rows always comes out as 0.

View 5 Replies View Related

Android :: Program Will Not Switch To Activity On My Phone

Oct 27, 2010

public class TestCamera extends Activity implements SurfaceHolder.Callback, View.OnClickListener {
Camera.PictureCallback mPictureCallback = new Camera.PictureCallback() {
@Override
public void onPictureTaken(byte[] data, Camera camera) {
// TODO Auto-generated method stub
picture = data } };
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ((keyCode == KeyEvent.KEYCODE_DPAD_CENTER)) {
mCamera.takePicture(null, null, mPictureCallback);
return true; }
return super.onKeyDown(keyCode, event); }
@Override
public void onClick(View view) {
switch(view.getId()) {
case R.id.camera:
picture_intent = new Intent(this, PictureViewer.class);
picture_intent.putExtra("picture", picture);
mCamera.startPreview();
startActivity(picture_intent); } }

In the emulator, the program behaves like it should. However, when I put this application on my phone (Nexus one), it doesn't switch to the new Activity when I touch the screen after I take a picture. If I touch the screen without taking a picture, it switches to the new activity. I can't figure out why my phone won't switch to the new Activity after taking a picture.

View 2 Replies View Related

Android :: Switch Between Activity With Rotation Animation

Nov 24, 2010

does anybody knows how to launch a new activity with rotation animation.That I would like to know if there is a way to do the same but instead of image, i will be activity (whith new layout).

View 1 Replies View Related

Android :: How Do I Switch To New Activity From A Custom Listview ?

Sep 1, 2010

I am in a situation like, i have custom list view. One button, with listitems. When i click the button, i need to switch the activity. But the calls, startActivityForResult(myIntent, 0); --> is a non static call. I couldnt initiate this function in onClickLIstener() for the button. Dont know how to proceed with this situation ? Can anyone help me out with this.? Code...

View 4 Replies View Related

Android :: Email App Switch Its 'main' Activity?

Dec 4, 2009

In android Email app, when I first launch it, it will shows me the 'account setup wizard' activity. But when I launch the Email app(after the account is set) again, it wont' show the 'account setup wizard' activity, it will show the 'Folder list activity ' instead.

How can it does the main activity switch (depends on the email account setup)?

View 2 Replies View Related

Android : Switch Activity Of Content Of Tab In Tabhost?

Dec 8, 2009

I have created a TabHost and in 1 of the tab, I have added the content using

mTabHost.addTab(mTabHost.newTabSpec("tab1")
.setIndicator(getString(R.string.dialerIconLabel),
getResources().getDrawable(R.drawable.ic_tab_dialer))
.setContent(intent));

Is it possible for me to switch the content's activity programatically after I called 'addTab of TabHost'?

View 1 Replies View Related

Android :: Process Started / No Errors / Activity Not Visible On Android

Jul 5, 2010

I have developed an App that launches and works fine on Android 1.5 and 1.6. When I try and use it on version higher then that the app's activity starts, progress dialogs pop up and I can see my Async Task executing and the info being returned via Logcat. No errors or exceptions are shown. But the Activity never displays. All I see is the progress dialog showing over the home screen and then nothing. The process is active and running under the DDMS view.

View 1 Replies View Related

HTC Desire :: Simple Guide To Follow To Get App2sd Working?

Jul 9, 2010

just wondering if theres a simple guide to follow to get app2sd working? rooted but just wanna get that working lol any help is appreicated :>)

View 2 Replies View Related

Android :: Switch Back To Previously Selected Tab After Activity Is Recreated?

Jun 13, 2010

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.

View 3 Replies View Related

Android : Way To Switch Over To Next Screen From Main Activity By Clicking On Button?

Nov 18, 2010

I am working on an application where I need to go to the next Screen form the Main Actvity when I Click on the Image Button of the Main Activity Screen. I had searched a bit on Net regarding this and found something like the OnClickListener method. I am still stuck for what exactly I want to do actually.

View 3 Replies View Related

Android :: Working Mobile Data Widget/switch

Nov 1, 2010

Can anyone recommend a good mobile data switch/widget that doesn't break the APN settings? I have one on my HTC but I need one for my wife's Orange San Francisco.

View 3 Replies View Related

HTC EVO 4G :: Orientation Switch Not Working

Jun 19, 2010

I noticed that the orientation on my evo is not working, I checked the orientation in the setting and it's enabled. I restarted the phone and still same problem, it will not switch during web browsing, email inbox, calculator, etc...

View 17 Replies View Related

HTC Hero :: Mobile Switch Not Working

Oct 20, 2009

I have 4 htc switches on my home screen, Wifi, Bluetooth, Mobile & GPS. The mobile one is not working all of the time, infact today ts not working at all, all the others are fine anyone else had these problems. Hero is rooted and running modaco's latest rom.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved