我怎么会复制一个数组说
float arraytobecopied[] = {1.20,2.50,3.60};
Run Code Online (Sandbox Code Playgroud)
到另一个已经有数据的数组已经说过了
float newarray[] = {5.20,6.30,4.20};
Run Code Online (Sandbox Code Playgroud)
我想将它添加arraytobecopied到新数组的末尾并保留数组中的值.另外作为旁注,这将是一个正在进行的过程,每次都会添加到数组的末尾.
我应该只使用for循环吗?或者,还有更好的方法.(不能使用数组)已经尝试过:(
在我的应用程序中,我有三个按钮,当单击一个按钮时,它调用一个线程启动的东西是我希望能够在edittext字符串中输入到线程并做一些工作然后让它返回到UI线程我可以在哪里显示它或将其放入opengl来显示一个对象.我已经阅读了Handles,我不确定我是否完全理解它们,也许有人知道如何制作我自己的处理程序代码.此外,我已经阅读了Async,我不认为这会对我的应用程序有利.(个人opion,如果它有利于我的应用程序让我知道)我的问题是当我输入按下该行时,我将如何从UI edittext获取信息在DrawingUtils类中的线程然后完成工作然后它返回到UI以显示或在openGl程序中输入?
这是MainActivity类:
public class MainActivity extends Activity implements OnClickListener {
EditText cl;
TextView info;
Button enter;
Button line;
Button arc;
Line callLine = new DrawingUtils.Line();
Enter callEnter = new DrawingUtils.Enter();
Arc callArc = new DrawingUtils.Arc();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
info = (TextView) findViewById(R.id.info);
enter = (Button) findViewById(R.id.enter);
line = (Button) findViewById(R.id.line);
arc = (Button) findViewById(R.id.arc);
Handler UIhandler = new Handler() {
@Override
public void handleMessage(Message msg) {
Bundle bundle = msg.getData();
String string = bundle.getString("myKey"); …Run Code Online (Sandbox Code Playgroud) 你好,之前可能会问过,但我找不到任何特别的东西.当我去运行我的程序时,我想出了一个nullpointer异常,程序无法运行.我仍然有点新鲜,不知道我的问题在哪里.
public class MainActivity extends Activity implements OnClickListener {
public ArrayList<Short> indexP = new ArrayList<Short>();
public ArrayList<Float> linep = new ArrayList<Float>();
public Float coords = (float) 0;
public short p = 0;
public TextView info = (TextView) findViewById(R.id.info);
public int l = 0;
GLSurfaceView ourSurface;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.cad);
ourSurface = new GLSurfaceView(this);
FrameLayout v = (FrameLayout) findViewById(R.id.display);
v.addView(ourSurface);
ourSurface.setRenderer(new GLRenderer());
Button line = (Button) findViewById(R.id.line);
final Button enter = (Button) findViewById(R.id.enter);
EditText cl = (EditText) …Run Code Online (Sandbox Code Playgroud) 我会写一些类似的东西:
Dim Counter As Integer
Dim a As Integer
Counter = 0
a = 1
Counter-a
Run Code Online (Sandbox Code Playgroud)
但是,VBA将其附加到此:
Dim Counter As Integer
Dim a As Integer
Counter = 0
a = 1
Counter a '<---------------This change is what I am confused about
Run Code Online (Sandbox Code Playgroud)
到目前为止,这是我的完整代码:
Private Sub SpinButtonM_SpinDown()
Dim Counter As Integer
Dim a As Integer
a = 1
Counter a
UserForm2.Month.Caption = Counter
End Sub
Run Code Online (Sandbox Code Playgroud)