What is Unterminated quoted string?

by sasan_f2...@fouladirad.com » Tue, 08 Mar 2011 05:41:19 GMT


Sponsored Links
 his is my simple code for an app that I'm making but when I try to
run it with the emulator this error shows up:

ActivityManager: am: 1: Syntax error: Unterminated quoted string


my code:
package com.android.SoccerAndroidProject;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;


public class MainActivity extends Activity implements OnClickListener
{
private static final String TAG = "Game";

//creating the names of the parts
Button onepointButton,twopointsButton,
threepointsButton,resetButton,
onepointButton2, twopointsButton2, threepointsButton2;

EditText homeButton,awayButton;

TextView textScoreHome,textScoreAway,textScoreBetween;
int score1 = 0;
int score2 = 0;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

Log.d(TAG, "onCreate started");

// I now have all my UI in the Java memory
onepointButton = (Button)findViewById(R.id.onepointButton);
onepointButton2 = (Button)findViewById(R.id.onepointButton2);
twopointsButton = (Button)findViewById(R.id.twopointsButton);
twopointsButton2 = (Button)findViewById(R.id.twopointsButton2);
threepointsButton = (Button)findViewById(R.id.threepointsButton);
threepointsButton2 = (Button)findViewById(R.id.threepointsButton2);
resetButton = (Button)findViewById(R.id.resetButton);

homeButton = (EditText)findViewById(R.id.homeButton);
awayButton = (EditText)findViewById(R.id.awayButton);

textScoreHome = (TextView)findViewById(R.id.textScoreHome);
textScoreAway = (TextView)findViewById(R.id.textScoreAway);
textScoreBetween = (TextView)findViewById(R.id.textScoreBetween);

// Initialize text views
textScoreHome.setText(String.valueOf(score1));

textScoreAway.setText(String.valueOf(score2));

textScoreBetween.setText("");

// Define button listeners
resetButton.setOnClickListener(this);
onepointButton.setOnClickListener(this);
onepointButton2.setOnClickListener(this);
twopointsButton.setOnClickListener(this);
twopointsButton2.setOnClickListener(this);
threepointsButton.setOnClickListener(this);
threepointsButton2.setOnClickListener(this);

Log.d(TAG, "onCreate done");

}

public void onClick(View src) {
switch(src.getId()) {
case R.id.resetButton:
score1=0;
score2=0;
textScoreHome.setText(String.valueOf(score1));
textScoreAway.setText(String.valueOf(score2));
break;
case R.id.onepointButton:
score1++;
textScoreHome.setText(String.valueOf(score1));
break;
case R.id.onepointButton2:
score2++;
textScoreAway.setText(String.valueOf(score2));



Re: What is Unterminated quoted string?

by Daniel Mack » Fri, 20 May 2011 09:30:37 GMT


 Hey,

On 4 Mrz., 02:14, "sasan_f2...@fouladirad.com"



I'm facing exactly the same problem under OS X 10.6, using Eclipse and
the Android SDK for 2.3.3 (version 10).

Did you find any solution for this issue yet? It seems to be entirely
unrelated to the actual code, though. Everything is freshly installed
and up-to-date.


Daniel

-- 


Sponsored Links


Other Threads

1. How to find out screen status: active/dark?

I've dug through the documentation but couldn't find a call that would
fit: Is there a way to find out the screen status (Active/dark)?

Thanks in advance!

P.S.
Here's the situation: I've got an app that implements the relevant
data processing and backend server connectivity through a Service that
I keep running on a reduced activity level when the user puts the
device to sleep (using end button), or when the screen timeout hits.
In the app code, I can follow this status change, because it triggers
calls to overloaded onStop() and onPause() methods of the app's
subclassed Activity. This way, I control active/reduced ("sleep")
activity levels of that Service. Everything's cool and dandy in this
scenario.

Enter an AppWidget that's using this Service in a similar fashion,
with functionality implemented in a subclass of AppWidgetProvider.

This changes the game - I have found no way to determine when to set
the Service to the reduced ("sleep") activity level from that point.
The app's Activity has long paused, and I keep the Service at active
level, as the widget needs updates from the Service similar to what
the Activity needs when in front. With the AppWidget on the home
screen, I want, and should (re: battery life), drop the Service's
activity level when the device enters sleep mode. The most elegant way
to handle this would be to detect whether the screen is dark, right
inside the Service. Any way to do this?

JP


--~--~---------~--~----~------------~-------~--~----~

2. How to change a Uri to a file?

Hi,all
       Now I get a Uri such as
             content://media/externel/images/media/72 ,
I want to change this to a file style . How to do this ? Thanks!
--~--~---------~--~----~------------~-------~--~----~

3. Using Prebuilt Toolchain with configure and make

4. intent from dialog and back ?

5. You're invited to try Times People

6. getFromLocation broken with Android 1.5 SDK?

7. Geocoder not returning results in 1.5 preview