come da oggetto, quando da mainactivity casto non mi viene riconosciuta la referenza al codice xml che creo es.
Button bottoncinoCarinissimo =(Button) findViewByID(R.id.stoBottoncinoNonStaInRUffa);
adt build v22.6
![]()
come da oggetto, quando da mainactivity casto non mi viene riconosciuta la referenza al codice xml che creo es.
Button bottoncinoCarinissimo =(Button) findViewByID(R.id.stoBottoncinoNonStaInRUffa);
adt build v22.6
![]()
occhio agli import!
Sicuro di aver aggiunto l'import corretto, ossia, "com.tuopacchetto.R" invece di "com.android.R" ?![]()
Follow me on:
Androidiani app
<!-- Place this tag where you want the widget to render. -->
<div class="g-person" data-width="180" data-href="//plus.google.com/113012341277613226011" data-theme="dark" data-rel="author"></div>
<!-- Place this tag after the last widget tag. -->
<script type="text/javascript">
window.___gcfg = {lang: 'it'};
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script><br>
<a class="twitter-timeline" href="https://twitter.com/xcesco89" data-widget-id="398762031488040960">Tweets di @xcesco89</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementB yId(id)){js=d.createElement(s);js.id=id;js.src=p+" ://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}} (document,"script","twitter-wjs");</script>
Estensione Androidiani per Google Chrome
Ciao Cesco
grazie per l'interesse, dunque in main ho questi import
mentre invece R e' nella directory last( ho usato sto nome perche' ho provato decine di volte)/gen/com.example.last/R.javapackage com.example.last;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.os.Build;
per piacere aiutami che sto uscendo passo tra clean, build e librerie.
Follow me on:
Androidiani app
<!-- Place this tag where you want the widget to render. -->
<div class="g-person" data-width="180" data-href="//plus.google.com/113012341277613226011" data-theme="dark" data-rel="author"></div>
<!-- Place this tag after the last widget tag. -->
<script type="text/javascript">
window.___gcfg = {lang: 'it'};
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script><br>
<a class="twitter-timeline" href="https://twitter.com/xcesco89" data-widget-id="398762031488040960">Tweets di @xcesco89</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementB yId(id)){js=d.createElement(s);js.id=id;js.src=p+" ://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}} (document,"script","twitter-wjs");</script>
Estensione Androidiani per Google Chrome
grazie, no way
anche inserendo l'import
la linea
EditText e=findViewById(R.id.EditText23); non viene resolved
cliccando sulla barra a sinistra della riga eclipse mi conferma che EditText23=0 ( non ha un indirizzo esadecimale, ovvero non e' scritto in R! nonostante ho scritto
ecco il main<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<EditText
android:id="@+id/EditText23"
android:layout_width="match_parent"
android:layout_height="358dp"
android:hint="Text here please Ivano" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Saved" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
</LinearLayout>
package com.example.last;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.os.Build;
import com.example.last.R;
public class MainActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment()).commit();
}
EditText e=findViewById(R.id.EditText23);
addSaveButtonListener();
}
private void addSaveButtonListener() {
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
/**
* A placeholder fragment containing a simple view.
*/
public static class PlaceholderFragment extends Fragment {
public PlaceholderFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main, container,
false);
return rootView;
}
}
}...public static final int useLogo=0x7f050003;
public static final int withText=0x7f05000c;
public static final int EditText23 = 0;
}
Potrebbe anche essere un errore relativo alle librerie o agli XML, quindi controlla l'Error log e vedi se da errore con qualche lib, altro proprio non mi viene in mente sinceramente O_O
Follow me on:
Androidiani app
<!-- Place this tag where you want the widget to render. -->
<div class="g-person" data-width="180" data-href="//plus.google.com/113012341277613226011" data-theme="dark" data-rel="author"></div>
<!-- Place this tag after the last widget tag. -->
<script type="text/javascript">
window.___gcfg = {lang: 'it'};
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script><br>
<a class="twitter-timeline" href="https://twitter.com/xcesco89" data-widget-id="398762031488040960">Tweets di @xcesco89</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementB yId(id)){js=d.createElement(s);js.id=id;js.src=p+" ://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}} (document,"script","twitter-wjs");</script>
Estensione Androidiani per Google Chrome
Ciao, probabilmente sono io che col cell non visualizzo bene il codice, ma a vederlo così l'xml sembrerebbe mal formato. Non vedo i tag di apertura dei vari elementi (relative layout textview, editview, button rcc.). Sicuro che eclipse non ti evidenzi degli errori nel file xml? Tra l'altro quando hai un errore nell'xml Eclipse non riconosce più il file r e ti da errore in ogni file java che lo usa
pibraccus e cesco, grazie per l'aiuto,
ci ho rinunciato, ho reinstallato eclipse ed ora funziona!
grazie