@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent in=getIntent();
Uri uri=in.getData();
// l.setText(uri.toString());
String p=uri.getQueryParameter(OAuth.OAUTH_VERIFIER);
CreateFolderActivity.m_provider.setOAuth10a(true);
try {
CreateFolderActivity.m_provider.retrieveAccessToken(p);
} catch (OAuthMessageSignerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (OAuthNotAuthorizedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (OAuthExpectationFailedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (OAuthCommunicationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
URL url = null;
try {
url = new URL("http://api.mendeley.com/oapi/library/folders?consumer_key=" + CreateFolderActivity.m_consumer_key);
} catch (MalformedURLException e1) …Run Code Online (Sandbox Code Playgroud) TextView txt=new TextView(productlist.this);
txt.setText(author.get(groupPosition));
TextView txt1=new TextView(productlist.this);
txt1.setText(price.get(groupPosition));
txt.setLayoutParams(new LayoutParams(70, LayoutParams.WRAP_CONTENT));
txt1.setLayoutParams(new LayoutParams(70,LayoutParams.WRAP_CONTENT));
LinearLayout ll=new LinearLayout(productlist.this);
ll.setOrientation(LinearLayout.HORIZONTAL);
ll.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
// ll.setGravity(Gravity.CENTER);
ll.addView(txt);
ll.addView(txt1);
return ll;
Run Code Online (Sandbox Code Playgroud)
嗨,这是可扩展的组视图的代码片段,ListView它给出了错误:
java.lang.ClassCastException android.view.viewgroup.$ layoutParam