Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error inflating class com.onegravity.rteditor.toolbar.HorizontalRTToolbar #21

Closed
zniter81 opened this issue Oct 1, 2015 · 2 comments
Closed

Comments

@zniter81
Copy link

zniter81 commented Oct 1, 2015

hi

I face this error when trying to use your RichText editor.
can you advice me my mistake is?

gradle file
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"

defaultConfig {
    applicationId "facebooklogin.myapplication"
    minSdkVersion 21
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.1gravity:android-rteditor:1.1.6'
}

Activity.xml

<include android:id="@+id/rte_toolbar_container" layout="@layout/rte_toolbar" />

<ScrollView
    android:id="@+id/rte_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentTop="true"
    android:layout_above="@id/rte_toolbar_container"
    android:layout_margin="4dp"
    android:fillViewport="true"
    android:scrollbarStyle="insideOverlay" >

    <com.onegravity.rteditor.RTEditText
        android:id="@+id/rtEditText_1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:gravity="top"
        android:hint="test"
        android:imeOptions="actionDone|flagNoEnterAction"
        android:inputType="textMultiLine|textAutoCorrect|textCapSentences" />

</ScrollView>

Activty java file
package facebooklogin.myapplication;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    try {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
    catch(Exception e) {

    String sf = e.toString();
    }
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.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();

    //noinspection SimplifiableIfStatement
    if (id == R.id.action_settings) {
        return true;
    }

    return super.onOptionsItemSelected(item);
}

}

@1gravity
Copy link
Owner

1gravity commented Oct 1, 2015

What error? I see a lot of code but no error message (as in stack trace)?
My guess though would be that you're not setting the theme for the Activity and/or the theme isn't defining all the attributes the toolbar is using.

I noticed that the readme doesn't elaborate on the theming so I just added a chapter about that. Please have a look at it.

@zniter81
Copy link
Author

zniter81 commented Oct 1, 2015

OK. I will try to set theme. Thanks for the prompt response.

@zniter81 zniter81 closed this as completed Oct 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants