Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Event handling...
Event handling... [message #1540334] Thu, 01 January 2015 12:29 Go to next message
Jonathan Camilleri is currently offline Jonathan CamilleriFriend
Messages: 91
Registered: July 2009
Member
I am trying to code a simple event-driven code handling method for clicking a button. I don't think I am writing this code good am I?

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (savedInstanceState == null) {
getFragmentManager().beginTransaction().add(R.id.container, new PlaceholderFragment()).commit();
}

Button btnFancyMethod = (Button) findViewById(R.id.container);
}

According to sample code R.id could include the name of the button but it does not appear on the namespace and I am not sure what to type instead of R.id.container.
Re: Event handling... [message #1540886 is a reply to message #1540334] Thu, 01 January 2015 19:52 Go to previous message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 01/01/2015 05:29 AM, Jonathan Camilleri wrote:
> I am trying to code a simple event-driven code handling method for clicking a button.

If today I refer you to an Android-development forum support, Jonathan,
it will not be the first time I and other have done so since you came to
this forum for help. Have you not understood this sticky post at the top
of the newcomers' forum?

https://www.eclipse.org/forums/index.php/t/225513/
Previous Topic:Build from terminal ok, from eclipse not
Next Topic:How to install sailfin plugin for eclipse luna
Goto Forum:
  


Current Time: Thu Apr 25 20:26:38 GMT 2024

Powered by FUDForum. Page generated in 0.07987 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top