Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Development > Application Development

Application Development Dev Lounge for the Coder Folks



Reply
 
LinkBack Thread Tools
Old December 18th, 2011, 06:43 PM   #1 (permalink)
New Member
 
Join Date: Dec 2011
Posts: 1
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Help a New Developer with a Simple Problem?

Hello! I just started android development, so I don't fully understand all of the jargon I type...

I came across a set of tutorials that described how to create and use radio buttons to change the gravity and style of text.

Here is my code:

package com.androidbook.myfirstandroidapp;

import android.app.Activity;[...]


public class tutorialOne extends Activity implements OnCheckedChangeListener{

TextView textOut;
EditText getInput;
RadioGroup Gunit;
RadioGroup Sunit;

@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.tutorial1);

textOut = (TextView) findViewById(R.id.tvGetInput);
getInput = (EditText) findViewById(R.id.etInput);
Button ok = (Button) findViewById(R.id.bOK);
Gunit = (RadioGroup) findViewById(R.id.rgGravity);
Sunit = (RadioGroup) findViewById(R.id.rgStyle);

Gunit.setOnCheckedChangeListener(this);

ok.setOnClickListener(new View.OnClickListener() {

public void onClick(View v) {
// TODO Auto-generated method stub
textOut.setText(getInput.getText());
}
});

}


public void onCheckedChanged(RadioGroup group, int checkedId) {

switch (checkedId){

case R.id.rbLeft:
textOut.setGravity(Gravity.LEFT);
break;
case R.id.rbCenter:
textOut.setGravity(Gravity.CENTER);
break;
case R.id.rbRight:
textOut.setGravity(Gravity.RIGHT);
break;
case R.id.rbNormal:
textOut.setTypeface(null, Typeface.NORMAL);
break;
case R.id.rbBold:
textOut.setTypeface(null, Typeface.BOLD);
break;
case R.id.rbItalics:
textOut.setTypeface(null, Typeface.ITALIC);
break;

}

}

}

The "tutorialOne" part above is an error according to Eclipse: "The type tutorialOne must implement the inherited abstract method RadioGroup.OnCheckedChangeListener.onCheckedChange d(RadioGroup, int)"

I tried to use the quick fix but another error came up: "Can not implement the missing methods, either due to compile errors or the projects build path does not resolve all dependencies."

What can I do?

atb1194 is offline  
Reply With Quote
Sponsors
Old December 19th, 2011, 09:30 PM   #2 (permalink)
New Member
 
Join Date: Dec 2011
Posts: 6
 
Device(s): HTC Hero, Droid Eris, Droid, Evo 4G, Epic 4G, Tattoo, Nexus S
Thanks: 1
Thanked 1 Time in 1 Post
Send a message via Skype™ to swarmconnect support@swarmconnect.com
Default

It should just be a matter of adding the "onCheckChange" method to your code. Check out the OnCheckChangeListener in the Android APIs to find the list of required methods.
swarmconnect is offline  
Reply With Quote
Reply

Bookmarks

Tags
developer, error, message, problem, simple


Go Back   Android Forums > Android Development > Application Development User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 11:57 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo