Okay so I'm VERY new to java and I'm trying to make a very simple android program. Basically I have a function, it will take in two integers and then display their product. But I don't think I'm passing the variables to the function correctly. Also I'm probably not converting the numbers to strings the right way (there doesn't appear to be a string datatype in standard java so i need some sort of library or something i assume).
Anyways here's the code
Code:package com.muc.whatever; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class helloagain extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); FUNCTION_1(3,4); } public void FUNCTION_1(int A,int B) { setContentView(R.layout.main); TextView tv = new TextView(this); tv.setText(A*B); setContentView(tv); } }


Reply With Quote

Bookmarks