Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Android Development Issues

Super new at this. I've been scouring this "forum" and have found a few people with the same issues, but no solutions. First of all, I can't get the KitchenSink app to run. It sticks at "Detected tiapp.xml change, forcing full re-build…" and just stays there. SDK 2.2, and using Titanium 1.2.1.

Second, I can't get a simple button click event to fire. Here's the code I have for that…

//
// Create Alert Dialog
//
var alertDialog = Titanium.UI.Android.createAlertDialog({
    title: 'Alert!',
    message: 'You have an alert!',
    buttonNames: ['OK','Cancel']
});

//
// create Button
//
var buttonMain = Titanium.UI.createButton({
   title: "Click me!",
   top:10,
   left:10,
   width:100,
   height:50,
   selectedColor:"Navy"
});

buttonMain.addEventListener("click",function(e){
   //subView.show();
   alertDialog.show();
});
winMain.add(buttonMain)

Any help or direction would be appreciated.

-MJC

— asked June 7th 2010 by Michael Collins
  • alert
  • android
  • button
0 Comments

2 Answers

  • Have you tried alertDialog.show? Not sure why you're prefixing your call with win.

    Without Trace level logs we won't be able to guide you on KS. You may want to open that up as a separate question.

    — answered June 7th 2010 by Don Thorp
    permalink
    1 Comment
    • Oh, yes. That's just my latest attempt to get it to work. All previous attempts just had alertDialog.show();

      — commented June 7th 2010 by Michael Collins
  • If you are able to create and run new Android applications, you should be able to copy the resources from the Kitchen Sink into a newly created mobile project.

    — answered June 7th 2010 by Kevin Whinnery
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.