Android :: Another Bug Found In TextView

Mar 8, 2010

I posted earlier with a less clear title. Unless someone can show me differently, I think I've found another bug in TextView.
res/values/colors.xml:
[Code]

Android :: Another Bug Found In TextView


Android :: 2 String In A TextView Listen Seperated Clickevent In 1 TextView

Nov 16, 2010

I want to do something like that. For example, I have a textview with String
Alibaba love Mary so muck. In that String alibaba and Mary have a event to open something but I can't know how to use event for Mary and Alibaba seperately

View 2 Replies View Related

Android :: Android RelativeLayout - Trying To Vertically Center A TextView When The TextView Below Has No Text

Jul 14, 2010

I have a ListView that contains an Image on the left of two vertically-oriented TextViews using a RelativeLayout. When both TextViews have text it looks fine. Sometimes the TextView on the bottom won't have any text, and the problem is that the entire layout is several pixels above where it should be because it still reserves that space for text when there isn't any making the entire list have annoying blank gaps. I remember seeing an example of where someone made the layout not reserve the space, but I can't remember how he did it.

View 2 Replies View Related

Create TextView On ActivityResult - No TextView Displaying

Jan 4, 2014

I'm trying to create a textView in the parent activity onActivityResult but the textView does not appear. There is an ImageView that takes up the whole parent activity. I can create a textView and place it, and it should go on top of the imageView?

In the parent class:

[HIGH]private void addClothes(int menuId) {
Intent chooseClothesIntent = new Intent(this, ChooseClothesActivity.class);
chooseClothesIntent.putExtra("menuId", menuId);
startActivityForResult(chooseClothesIntent, 1);
}[/HIGH]

[Code]...

then in my new activity:

[HIGH]@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
try {
ClothingItem ci = mListContents.get(position);
String imagePath = ci.getImagePath();

[Code]...

View 2 Replies View Related

Clear Textview And Add New Textview While Click Next Category?

May 4, 2013

In my Android application I have to display article title on corresponding category.

I wish to display the output in following format:

[HIGH]Languages Programming --- Category name on Horizontal listview[/HIGH]

If I have to click Languages which means getting the article title for that selected category alone and displaying on Horizontal listview.

[HIGH]Languages Programming

Tamil Engilsh Hindi Telugu[/HIGH]
If I have to click Programming means need to display the :

[HIGH]Languages Programming

Java C C++[/HIGH]

Now my current status is :

I have to run the app and click Languages which means getting the output is :[code]....

View 2 Replies View Related

Android :: Android TextView's Background Not Moving When TextView - Padding Changes

Apr 28, 2010

I have a TextView that I created in the main.xml. In my app.java I am dynamically positioning that TextView based on where the user taps the screen. The problem I am having is that when I call myTextView.setPadding(100,100,0,0), it moves the actual Text of the TextView, but does not move the Colored Background of the TextView.

View 3 Replies View Related

Android :: How Can Pass Text Of Textview From One Class To Other Class Textview

Oct 15, 2010

if there are five text in a text view and we want to pass one of them on click event to the next class text view which method i m used on android

View 2 Replies View Related

Android :: How To Divide TextView Into 2 Seperate TextView In Android

Nov 15, 2010

I have a problem with TextView in Android

I am making an application like Facebook. In m.facebook.com, when I open it I see they do one thing specailly.

(Alice) is writing on (BackStreetBoy1010938920) wall

Because the width of Mobile screen is small so the real message like tha

(Alice) is writing on (BackStreet

Boy10101009393) wall

I guess they use TextView for (BackStreetBoy1010938920) but I can't do like this.

View 2 Replies View Related

Android :: No Resource Found Error

May 24, 2010

I got "no resource found that matches the given name(at 'id' with value @id+/textview')" my main.xml file looks like this: <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android=" http://schemas.android.com /apk/res/android" android:id="@id+/textview" android:layout_width="fill_parent" android:layout_ height="fill_parent" android:text="@string/greetings"/> Any idea what I am missing? You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+ unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com /group/android-developers?hl=en

View 3 Replies View Related

Android :: Thread Error Needs To Be Found

Sep 8, 2010

I am placing a code below, I have created a local Thread and getting Error at the last Closing Braces, Can anybody please sort it out for me.Thread dt = new Thread(this)

View 2 Replies View Related

Android :: Org.eclipse.wst.sse.core 0.0.0' But It Could Not Be Found

Nov 22, 2010

I'm installing the Android SDK on a fresh installation of Fedora 14 (Linux).

I installed eclipse, and ran the tools/android sdk tool to install all the Eclipse components for the SDK.

I was able to get DDMS to install when selecting it by itself.

And for the last component - the Android developer tools, I'm getting the ugly error message pasted below.

Now I'm Stuck in Eclipse dependency hell.

I've searched through the available packages in Fedora and I can't find the one that has the files necessary to satisfy this Eclipse dependency...

Can anybody please translate what it is that Eclipse is asking for and what Fedora package it lives in?

The error:

Cannot complete the install because one or more required items could not be found.

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

View 1 Replies View Related

Android :: Aap Not Found When Building New App In NetBeans

Apr 21, 2010

I just installed NetBeans and the Android SDK following the instructions here. I am running Ubuntu 9.10 (Karmic). NetBeans is 6.7.1. The Android SDK is version 7.W.When I go into that directory, I see that the file does exist and it has proper permissions to be executable by anyone, yet even bash can't find it!

View 3 Replies View Related

Android :: KeyStore JKS Implementation Not Found

Dec 5, 2009

I am trying to create certificates for users for my program. I am have created a keystore and included the publickeystore.store with my application in the assets folder. I created all the certificates using the keytool program from JAVA. When I try to authenticate the certificate I get the following error: 12-05 17:32:49.962: ERROR/AndroidRuntime(891): Caused by: java.security.KeyStoreException: KeyStore JKS implementation not found

View 3 Replies View Related

Android :: XML - Multiple Annotations Found

Jul 29, 2010

I've been going on and on with my XML file and I can't seem to find any problem. The file doesn't show any problem in the code but there's the red box on the right which reads: Multiple annotations found at this line: - The processing instruction target matching "[xX][mM][lL]" is not allowed. - No grammar constraints (DTD or XML schema) detected for the document. Here is the XML code: <?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" android:background="@color/ android:padding="6dp" <ImageView android:id="@+id/header" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/send" android:scaleType="fitXY" android:layout_alignParentTop="true".......

View 9 Replies View Related

Android :: File Path NOT Found

Aug 4, 2010

I trying to do XML parsing program. I also used FileInputStream for my XML file. I placed XML file under android's assets folder,META-INF folder. That's file name is "container.XML". Here is my code parseXML,

public void parseXMLinfoBook() throws FileNotFoundException, ParserConfigurationException, SAXException{

FileInputStream in = new FileInputStream("file:///android_asset/META-INF/container.xml");

StringBuffer inLine = new StringBuffer();
InputStreamReader isr = new InputStreamReader(in);

BufferedReader inRd = new BufferedReader(isr);

SAXParserFactory spf=SAXParserFactory.newInstance();..................

View 1 Replies View Related

Android :: App To Download - Animation Not Found?

Jun 8, 2010

When you go to the App to download, it says it's not found. Any one else have this issue, or know what's wrong? I've tried syncing it too.

View 6 Replies View Related

Android :: Not Able To Found Intent Filters

Oct 31, 2010

I'm writing a client application for an Italian social network (Meemi) and I'd like to give the possibility to users to share their calendar events via my client. I noticed on my device (HTC Desire) that is possible to access to a "share chooser" from the Calendar event list: in fact I can share via email, sms, and bluetooth. I'd like to add my client to the this sharing list: but I'm not able to found the right intent filter to use.

View 2 Replies View Related

Android :: Activity Not Found Exception?

Aug 20, 2010

I am using startActivity to call another Activity and I get the "Activity Not Found Exception".

Here is my code:

CODE:......

Here is the Logcat output:

CODE:.....

Here is the debug window output:

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

symptomRemedyActivity is another activity in my project. Is there something I need to do like importing symptomRemedyActivity so that startActivity can see symptomRemedyActivity, to remove this "Activity Not Found Exception"?

View 1 Replies View Related

Android :: No Resource Found That Matches Given Name Label With Value

Nov 23, 2010

im using a tutorial from the book hello android and i have come across said error, any help would be great as its for a uni project, files are below...........

View 2 Replies View Related

Android :: Error - No Resource Found That Matches Given Name

Jul 16, 2010

I am new to android, I try to create layout so that I have background image, and have a ImageView with animation start from bottom right of screen and along with a TextView stay on top of this ImageView. (Hope my describe make sense).

My problem is when I try use "android:layout_above="@id/flyobject"", the eclipse alway say: error: Error: No resource found that matches the given name (at 'layout_above' with value '@id/flyobject'). But as for sure I have defined flyobject, and I can find it's in my R class.

Here is my XML file:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/ android"android:layout_width="fill_parent" android:layout_height="fill_parent">
<ImageView android:id="@+id/background"android:src = "@drawable/background"android:layout_width="fill_parent"android:layout_height="fill_parent" android:scaleType="centerCrop"/>
<TextViewandroid:id="@+id/flytext"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_above="@id/flyobject"/>
<ImageViewandroid:id="@+id/flyobject"android:src="@drawable/asteroid01"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_alignParentRight="true"android:layout_alignParentBottom="true"/> </RelativeLayout>

View 3 Replies View Related

Android :: Not Found Exception For Compiled Class

Nov 15, 2010

I am writing an application and due to various reasons I had to build it using make (froyo code) and not SDK. When I run my app on emulator it works fine. I have an Android device and code to build image for the device. When I build my app with device code, it builds fine. How ever, when I run the application, I get
java.lang.ClassNotFoundException:
<package.class> in loader dalvik.system.PathClassLoader[.]

A source file in my code is actually doing
sourceClass = classLoader.loadClass(sourceName);
sourceName here is pointing to a class I actually build (I have classname.java file in my code under correct package directory and package name). Note that this app is running fine on emulator, but on a device it is failing.

I verified that the .class file exists in out/target/common/obj/APPS/ xxxApp_intermediates/classes.jar, classes-full-debug.jar, classes-full- names.jar

View 2 Replies View Related

Android :: Exiting From Xml.parse When Match Found

Aug 18, 2010

I'm using the Android SAX parser to search for entries in a rather large (6MB) XML file. I'm basically using a derivative of the code shown in listing 8 here. The question I have is how do I stop parsing once my match has been found? The code shown continues parsing through the end of the file but I want to stop before then. Is this possible or do I need to use something other than SAX

View 1 Replies View Related

Android :: Running Emulator Not Found From Within Eclipse?

Oct 10, 2009

When launching my app from within Eclipse, sometimes the running emulator is found and displayed in the launch dialog, sometimes it isn't?! Killing adb, the emulator and Eclipse usually helps until it happens again. Any idea why this is? I see this behavior since the launch of Android. I am running on Mac OS X. And it happened on Leopard as well as Snow Leopard.

View 9 Replies View Related

HTC EVO 4G :: Missing Sync Not Found In Android Market?

Jun 6, 2010

I downloaded the missing sync from the market on Friday morning. I had to reset my handset because of the default settings of facebook doubled my contacts. Since setting the option of not to sync them doesn't take them away, I had to do a hard reset to get them out. I've downloaded most of my apps again, except Missing Sync. I can find it via the computer, but when I try to find it and download via either appbrain or directly from the market either I can't find it or it will not allow me to install the app with the following error - There are no matches in Android Market for the search:
pname:com markspace.missingsync

View 4 Replies View Related

HTC Desire :: Android Market Not Found After Upgrading To 2.2

Oct 12, 2010

I bought a new HTC desire last week with Android 2.1 version, after upgrading to android 2.2 version there is no "Android Market" available in my phone.

View 2 Replies View Related

Android :: If Second Application Installed On Phone Then First Will Not Found

Jan 28, 2010

when I had tried to install any application for the first time , it gives me following error as. D:Pramod Backupandroidandroid-sdk-windowsools>adb install pramod.apk 77 KB/s (8628 bytes in 0.109s) pkg: /data/local/ tmp/ pramod.apk Failure [INSTALL_FAILED_ALREADY_EXISTS] But there is no pramod.apk file is present in phone , but if I install the application using -l -r as D:Pramod Backupandroidandroid-sdk-windows ools>adb install -l -r pramod.apk 38 KB/s (8628 bytes in 0.218s) pkg: /data/local/tmp/pramod.apk Success It will installed application succesfully. Why is it so? and when I tried another application to install as D:Pramod Backupandroidandroid-sdk-windowsools>adb install -l -r Final.apk 38 KB/s (8628 bytes in 0.218s) pkg: /data/local/tmp/Final.apk Success then previous application (i.e here pramod.apk) not shown in phone.

View 4 Replies View Related

Android :: How Is App Found On Marketplace / If Can't Enter Keywords?

Nov 18, 2010

Just submitted my first app and was surprised to see there was nowhere to enter keywords.How is our app supposed to be found on the marketplace if we can't enter keywords?

View 1 Replies View Related

Android :: Source Not Found - Program Crashes

Aug 30, 2010

I'm getting an error in my Android app that says "source not found" and crashes the program. I've already read a number of posts saying that the solution is to download the android source code and load that up in Eclipse, but I tried to no avail. Here is a bunch of information that may help with my problem, let me know if you need more!

Stack:
Thread [<1> main] (Suspended (exception RuntimeException))
ActivityThread.performLaunchActivity(ActivityThrea d$ActivityRecord, Intent) line: 2663
ActivityThread.handleLaunchActivity(ActivityThread $ActivityRecord, Intent) line: 2679
ActivityThread.access$2300(ActivityThread, ActivityThread$ActivityRecord, Intent) line: 125
ActivityThread$H.handleMessage(Message) line: 2033
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]

Is it weird that the first entry is 'ActivityThrea d' with the 'd' cut off? If this is the problem, what went wrong and how do I fix it? The line of code the debug stops on:

public void AddAnimationID(String index, Integer view)
{ animations.put(index, view);
}
'animations' is a Dictionary and is a member of class Alien. I am calling it like:
Alien alien;
alien.AddAnimationID("idle", R.drawable.idle);
I am correct in thinking that R.drawable.idle is an int right? findViewByID takes an int for the argument. Here is the logcat, I tried to pinpoint where in the log it started the application, sorry if its too much.

I/ActivityManager(59): Displayed activity com.android.launcher/com.android.la
uncher2.Launcher: 21357 ms (total 21357 ms)
I/Launcher.Model(118): not binding apps: no Launcher activity
D/dalvikvm(118): GC_EXPLICIT freed 5222 objects / 297520 bytes in 114ms
D/dalvikvm( 118): GC_EXPLICIT freed 11360 objects / 562112 bytes in 94ms
D/PackageParser(59): Scanning package: /data/app/vmdl45576.tmp
I/PackageParser(59): Game.Main: compat added android.permission.WRITE_EXTERNA
L_STORAGE android.permission.READ_PHONE_STATE
I/PackageManager(59): Removing non-system package:Game.Main
I/ActivityManager(59): Force stopping package Game.Main uid=10032
D/dalvikvm(118): GC_EXTERNAL_ALLOC freed 319 objects / 18064 bytes in 73ms
D/dalvikvm(59): GC_FOR_MALLOC freed 6857 objects / 349752 bytes in 400ms
D/PackageManager(59): Scanning package Game.Main
I/PackageManager(59): Package Game.Main codePath changed from /data/app/Game.
Main-2.apk to /data/app/Game.Main-1.apk; Retaining data and using new
I/PackageManager(59): /data/app/Game.Main-1.apk changed; unpacking
D/installd(34): DexInv: --- BEGIN '/data/app/Game.Main-1.apk' ---
I/ActivityManager(59): Starting activity: Intent { act=android.intent.action.
MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=Game.Main/.Main }

D/dalvikvm(258): DexOpt: load 116ms, verify 200ms, opt 2ms
D/installd(34): DexInv: --- END '/data/app/Game.Main-1.apk' (success) ---
W/PackageManager(59): Code path for pkg : Game.Main changing from /data/app/G
ame.Main-2.apk to /data/app/Game.Main-1.apk
W/PackageManager(59): Resource path for pkg : Game.Main changing from /data/a
pp/Game.Main-2.apk to /data/app/Game.Main-1.apk
D/PackageManager(59): Activities: Game.Main.Main
I/ActivityManager(59): Force stopping package Game.Main uid=10032
E/Launcher(118): Unable to launch. tag=ApplicationInfo(title=Alien Game) inten
t=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER]flg=0x10200000 cmp=Game.Main/.Main }
E/Launcher(118): android.content.ActivityNotFoundException: Unable to find exp
licit activity class {Game.Main/Game.Main.Main}; have you declared this activity in your AndroidManifest.xml?
E/Launcher(118): at android.app.Instrumentation.checkStartActivityResult(
Instrumentation.java:1404)
E/Launcher(118): at android.app.Instrumentation.execStartActivity(Instrum
entation.java:1378)
E/Launcher(118): at android.app.Activity.startActivityForResult(Activity.
java:2817)
E/Launcher(118): at com.android.launcher2.Launcher.startActivityForResult
(Launcher.java:1053)
E/Launcher(118): at android.app.Activity.startActivity(Activity.java:2923)
E/Launcher(118): at com.android.launcher2.Launcher.startActivitySafely(Launcher.java:1462)
E/Launcher(118): at com.android.launcher2.AllApps2D.onItemClick(AllApps2D
.java:178)
E/Launcher(118): at android.widget.AdapterView.performItemClick(AdapterVi
ew.java:284)
E/Launcher(118): at android.widget.AbsListView$PerformClick.run(AbsListVi
ew.java:1696)
E/Launcher(118): at android.os.Handler.handleCallback(Handler.java:587)
E/Launcher(118): at android.os.Handler.dispatchMessage(Handler.java:92)
E/Launcher(118): at android.os.Looper.loop(Looper.java:123)
E/Launcher(118): at android.app.ActivityThread.main(ActivityThread.java:4627)
E/Launcher(118): at java.lang.reflect.Method.invokeNative(Native Method)
E/Launcher(118): at java.lang.reflect.Method.invoke(Method.java:521)
E/Launcher(118): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/Launcher(118): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/Launcher(118): at dalvik.system.NativeStart.main(Native Method)
I/installd(34): move /data/dalvik-cache/data@app@Game.Main-1.apk@classes.dex
-> /data/dalvik-cache/data@app@Game.Main-1.apk@classes.dex
D/PackageManager(59): New package installed in /data/app/Game.Main-1.apk
I/ActivityManager(59): Force stopping package Game.Main uid=10032
I/ActivityManager(59): Start proc com.svox.pico for broadcast com.svox.pico/.
VoiceDataInstallerReceiver: pid=259 uid=10028 gids={}
D/dalvikvm(157): GC_EXPLICIT freed 4079 objects / 247824 bytes in 605ms
D/dalvikvm(59): GC_EXPLICIT freed 6136 objects / 382312 bytes in 493ms
W/RecognitionManagerService( 59): no available voice recognition services found
I/installd(34): unlink /data/dalvik-cache/data@app@Game.Main-2.apk@classes.dex
D/AndroidRuntime(191): Shutting down VM
D/jdwp(191): adbd disconnected
I/AndroidRuntime(191): NOTE: attach of thread 'Binder Thread #3' failed
I/ActivityThread(259): Publishing provider com.svox.pico.providers.SettingsPro
vider: com.svox.pico.providers.SettingsProvider
D/AndroidRuntime(269):
D/AndroidRuntime(269): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
D/AndroidRuntime(269): CheckJNI is ON
D/AndroidRuntime(269): --- registering native functions ---
I/ActivityManager(59): Starting activity: Intent { act=android.intent.action.
MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=Game.Main/.Main }

I/ActivityManager(59): Start proc Game.Main for activity Game.Main/.Main: pid=273 uid=10032 gids={1015}
I/ARMAssembler(59): generated scanline__00000077:03545404_00000004_00000000 [ 47 ipp] (67 ins) at [0x322b68:0x322c74] in 4370882 ns
W/Game.Main.Main(273): SIS is null
D/AndroidRuntime(273): Shutting down VM
W/dalvikvm(273): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
E/AndroidRuntime(273): FATAL EXCEPTION: main
E/AndroidRuntime(273): java.lang.RuntimeException: Unable to start activity ComponentInfo{Game.Main/Game.Main.Main}: java.lang.NullPointerException
E/AndroidRuntime(273): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
E/AndroidRuntime(273): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
E/AndroidRuntime(273): at android.app.ActivityThread.access$2300(Activi
tyThread.java:125)
E/AndroidRuntime(273): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
E/AndroidRuntime(273): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(273): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(273): at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime(273): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(273): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(273): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime(273): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/AndroidRuntime(273): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(273): Caused by: java.lang.NullPointerException
E/AndroidRuntime(273): at Game.Main.Main.onCreate(Main.java:81)
E/AndroidRuntime(273): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime(273): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
E/AndroidRuntime(273): ... 11 more
W/ActivityManager(59): Force finishing activity Game.Main/.Main
I/ActivityManager(59): Starting activity: Intent { act=android.intent.action.
MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=Game.Main/.Main }
D/AndroidRuntime(269): Shutting down VM
D/jdwp (269): adbd disconnected
I/AndroidRuntime(269): NOTE: attach of thread 'Binder Thread #3' failed
W/ActivityManager(59): Activity pause timeout for HistoryRecord{43ed84f8 Game.Main/.Main}
I/ARMAssembler(59): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x305640:0x3056fc] in 1148283 ns
W/ActivityManager(59): Launch timeout has expired, giving up wake lock!

Here is the class Alien:
package Game.Main;
import java.util.Dictionary;
import android.graphics.drawable.AnimationDrawable;
import android.widget.ImageView;
public class Alien {
private AlienState state;
private Dictionary<String, Integer> animations;
private ImageView imageView;
public Alien() {
}
public void AddAnimationID(String index, Integer view) {
animations.put(index, view);
}
public Integer GetAnimationID(String index) {
return animations.get(index);
}
public void SetImageView(ImageView view) {
imageView = view;
if(animations.get("idle") != null) {
imageView.setBackgroundResource(R.drawable.idle);
state = AlienState.idle;
} }
public ImageView GetImageView() {
return imageView;
} public void ChangeView(String index) {
if(animations.get(index) != null) {
imageView.setBackgroundResource(animations.get(index));
state = AlienState.valueOf(index);
} } }

Here is the onCreate function that this is called from and related information:
package Game.Main;
import java.util.ArrayList;
import java.util.List;
import Game.Main.MainView.MainThread;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.speech.RecognizerIntent;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation.AnimationListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

public class Main extends Activity implements OnClickListener {
private static final int VOICE_RECOGNITION_REQUEST_CODE = 1234;
private ArrayList<String> dictionary;
private TextView txtText;
private MainThread thread;
private MainView view;
private AnimationDrawable anim;
private Alien alien;
@Override // called when Main is created.
public void onCreate(Bundle savedInstanceState) {
// reload from previous instance
super.onCreate(savedInstanceState);
// set default content view
setContentView(R.layout.main);
view = (MainView)findViewById(R.id.mainView);
thread = view.GetThread();
if (savedInstanceState == null) {
// we were just launched: set up a new game
thread.SetState(GameState.Active);
Log.w(this.getClass().getName(), "SIS is null");
} else {
// we are being restored: resume a previous game
thread.RestoreState(savedInstanceState);
Log.w(this.getClass().getName(), "SIS is nonnull");
} // setup speak button
Button speakButton = (Button)findViewById(R.id.btn_speak);
// setup text box
txtText = (TextView)findViewById(R.id.txt_text);
// setup our dictionary
dictionary = new ArrayList<String>();
dictionary.add("sit");
dictionary.add("eat");
dictionary.add("jump");
dictionary.add("think");

alien.AddAnimationID("idle", R.drawable.idle);
alien.AddAnimationID("eat", R.drawable.eat);
alien.AddAnimationID("jump", R.drawable.jump);
alien.AddAnimationID("think", R.drawable.think);
alien.AddAnimationID("run", R.drawable.run);
alien.AddAnimationID("sit", R.drawable.sit);
alien.SetImageView((ImageView)findViewById(R.id.alien_image));
// check to see if a recognition activity is present
PackageManager pm = getPackageManager();
List<ResolveInfo> activities = pm.queryIntentActivities(new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0);
// if activities were found, cancel speech recognition
if (activities.size() != 0)
speakButton.setOnClickListener(this);
else {
speakButton.setEnabled(false);
speakButton.setText("Recognizer not present");
} }
I am using Eclipse on Windows 7 x64. I have all of the newest updates to the android SDK and I downloaded the android source code and added it to the Eclipse patch because previous posts led me to try that. The code breaks for debug when the first time AddAnimationID is called. Looks like I didn't have enough breakpoints, the culprit is not the AddAnimationID function but actually the SetImageView one. The if statement seems to not work, so I've commented it out for now. I'll post back once I've figured it out. It's probably something silly that works in another language but not Java.

View 1 Replies View Related

Android :: Page Not Found - YouTube Application?

Jul 28, 2010

I've got a Samsung galaxy spica which refuses to play youtube videos. I can browse videos through m.youtube.com, but the moment I click on a video my browser switches to a 'page not found'. Someone on the spica forum suggested that I need to ensure I've got the youtube app installed - but I can't find it on the market, and for some reason I don't have it pre-installed on my phone! Where/how can I get a hold of this app? (Or, failing that, what can I do to get youtube videos to play on my phone?)

View 4 Replies View Related

Android :: No Element Found. And It Won't Generate R.java Because Of It.

Nov 20, 2010

I am getting a parsing error and I do not know why (I am new to programing). Because of this error, R.java disappears and I end up having more errors. Hopefully someone can help me out. Here is where the error comes from: list.xml. Code...

View 2 Replies View Related







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